I want my actor hero collides with a platform like this

I want that the acot hero collides when the platform(the barrel) is interpolating up and down can you help me?
here is the image

Comments

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291

    Hey @agueis,

    this is fairly simple to do. Just create an actor that the hero will collide with. Place in the scene where your yes bar is at. Constrain it's x and y to the barrels x and y (depending on where you want it at in regards to the barrel. Once finished, set it's alpha to 0 then in the hero you can have the collision rules, when hero overlaps or collides with the bar, do your rules!

    Hope that helps and makes sense!

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    Note: If the object (barrel?) is not going to more anywhere, you don't have to constrain the invisible actor to it.

    Mental Donkey Games
    Website - Facebook - Twitter

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291

    Hey @NipaDidIt,

    I mentioned constrain because in his post he said;

    @agueis said:
    (the barrel) is interpolating up and down can you help me?

    Also, even if it doesn't move, doesn't really matter if you us constrain or change attribute.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited February 2015

    I somehow missed that. Just woke up and didn't yet finish my coffee :smiley:

    Mental Donkey Games
    Website - Facebook - Twitter

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291

    @NipaDidIt said:

    Hahaha, it's all good! Happens to me as well! Sending you a virtual coffee right away!

  • agueisagueis Member Posts: 420

    Hello KillerPenguinStudios how can i Constrain x and y to the barrel?

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    You need to make two game attributes (real). BarrelX and BarrelY.

    In the barrel actor make two constrain behaviors like this:
    -Constrain attribute game.barrelX to self.position X.
    -Constrain attribute game.barrelY to self.position Y.

    Then in the invisible actor that you want to constrain to the barrel, make two constrain behaviors:
    -Constrain attribute self.position X to game.barrelX.
    -Constrain attribute self.position Y to game.barrelY.

    Mental Donkey Games
    Website - Facebook - Twitter

  • SocksSocks London, UK.Member Posts: 12,822

    @NipaDidIt said:
    You need to make two game attributes (real). BarrelX and BarrelY.

    In the barrel actor make two constrain behaviors like this:
    -Constrain attribute game.barrelX to self.position X.
    -Constrain attribute game.barrelY to self.position Y.

    Then in the invisible actor that you want to constrain to the barrel, make two constrain behaviors:
    -Constrain attribute self.position X to game.barrelX.
    -Constrain attribute self.position Y to game.barrelY.

    If the barrel is moving up and down you would only need Y.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited February 2015

    @Socks true, but @agueis asked for x and y.

    Mental Donkey Games
    Website - Facebook - Twitter

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2015

    @NipaDidIt said:
    Socks true, but agueis asked for x and y.

    That's only because he's been told he needs to constrain the collision actor to the barrels' X and Y, it's not really him asking for X and Y, he's just following the instructions given in this thread.

  • agueisagueis Member Posts: 420

    Thank you very much

  • agueisagueis Member Posts: 420

    forgot to ask something, how my actor hero collides with the invisible actor?

  • SocksSocks London, UK.Member Posts: 12,822

    @agueis said:
    forgot to ask something, how my actor hero collides with the invisible actor?

    Use the collide behaviour.

  • agueisagueis Member Posts: 420

    My actor hero must only collide with the invisible actor with that rules?

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291

    @Socks said:
    That's only because he's been told he needs to constrain the collision actor to the barrels' X and Y, it's not really him asking for X and Y, he's just following the instructions given in this thread.

    I said to constrain to both only for the fact in case he were to have them at some point go horizontal and not just vertical. Just covering all bases! ;)

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291

    @NipaDidIt said:
    You need to make two game attributes (real). BarrelX and BarrelY.

    In the barrel actor make two constrain behaviors like this:
    -Constrain attribute game.barrelX to self.position X.
    -Constrain attribute game.barrelY to self.position Y.

    Then in the invisible actor that you want to constrain to the barrel, make two constrain behaviors:
    -Constrain attribute self.position X to game.barrelX.
    -Constrain attribute self.position Y to game.barrelY.

    I see an issue with this @NipaDidIt, the issue is if there are multiple barrels in the scene then it will not work correctly.

    What you need to do @agueis is first open each of the barrels in your scene and they all will have the same name, (lets say it's name is barrel) give each barrel in the scene a new name such as barrel 1; barrel 2; barrel 3; etc. We do this so we can call a specific barrels coordinates from within each invisible actor.

    Next, lest open the invisible actor that is placed in the scene that will correspond to barrel 1. Unlock it then what you will need to do is use 2 constrain attributes. (One for x and one for Y) In the first constrain attribute, constrain its self. Position. X to Current scene. (layers). "select the layer in which barrel 1 is on". barrel 1. Position. X.

    Do the same as above but for its Y position.

    Do this for each invisible actor in your scenes for each of the barrels.

    REMEMBER

    When an actor is unlocked in the scene, any rules, attributes, etc. added or removed from the actor will only happen when you go into that actor in the scene.

    Hope that helps!

  • agueisagueis Member Posts: 420

    Thanks very much KillerPenguinStudios

  • jay2dxjay2dx Member Posts: 611
    edited February 2015

    @socks @KillerPenguinStudios just signed in to say I think its great that experienced members like yourselves is still helping out the new guys :) nice one... I remember socks helping me out when I first started a year ago. keep it up man its really appreciated by all.

    Jay

  • agueisagueis Member Posts: 420

    Hi Ja2dx yes they are very good persons but i´m not a new guy i have 3 games in app store , greetins :)

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291

    Thanks for your kind words @jay2dx, I like to help out any chance I get! I was a newbie once (not saying you are @agueis) and I like to give back what others have given to me!

  • LovejoyLovejoy Member Posts: 2,078

    By that logic, @Socks has no games in the App Store so he must be a noob :trollface:

    Fortuna Infortuna Forti Una

  • jay2dxjay2dx Member Posts: 611

    You asked a simple noob question so you are still the new guy! I asked the same question once I've got 7 games on the App Store and I still consider my self quite the noob! :) haha

  • agueisagueis Member Posts: 420

    depends , I do things you do not know do in gamesalad , and you do things I do not in GameSalad :)

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291

    Wow, this is escalating quickly!!! lol :p

Sign In or Register to comment.