I want my actor hero collides with a platform like this
agueis
Member Posts: 420
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
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!
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
Hey @NipaDidIt,
I mentioned constrain because in his post he said;
Also, even if it doesn't move, doesn't really matter if you us constrain or change attribute.
I somehow missed that. Just woke up and didn't yet finish my coffee
Mental Donkey Games
Website - Facebook - Twitter
Hahaha, it's all good! Happens to me as well! Sending you a virtual coffee right away!
Hello KillerPenguinStudios how can i Constrain x and y to the barrel?
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
If the barrel is moving up and down you would only need Y.
@Socks true, but @agueis asked for x and y.
Mental Donkey Games
Website - Facebook - Twitter
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.
Thank you very much
forgot to ask something, how my actor hero collides with the invisible actor?
Use the collide behaviour.
My actor hero must only collide with the invisible actor with that rules?
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!
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!
Thanks very much KillerPenguinStudios
@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
Hi Ja2dx yes they are very good persons but i´m not a new guy i have 3 games in app store , greetins
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!
By that logic, @Socks has no games in the App Store so he must be a noob
Fortuna Infortuna Forti Una
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
depends , I do things you do not know do in gamesalad , and you do things I do not in GameSalad
Wow, this is escalating quickly!!! lol