How to constrain an actor to platform movement?
Hi everybody,
As the title above, i wanna ask about how to constrain an actor to platform movement?
I have an actor that if i press a command button the actor being thrown to a platform that move left and right repeatedly, the problem is when it thrown and collide with the moving platform, the actor didn't follow the platform movement. Any idea how to fix it? to make the actor follow the platform movement.
Thx before
As the title above, i wanna ask about how to constrain an actor to platform movement?
I have an actor that if i press a command button the actor being thrown to a platform that move left and right repeatedly, the problem is when it thrown and collide with the moving platform, the actor didn't follow the platform movement. Any idea how to fix it? to make the actor follow the platform movement.
Thx before
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
Comments
What value of gravity do you use?
Play modifying that and you got solved.
then, you should put a Constrain Attribute behavior into your Platform Actor that constrains game.PlatformPosX to self.Position X
then, you should create a Rule that says when Platform collides with Player, Constrain Player Position X to game.PlatformPosX. your Platform or Player Actor should have a Collide behavior too, you'll then choose the Bounciness value as preferred.
all this will allow your Player to follow the x movement of the Platform, in the center of the Platform.
hope this helps
really? I have tried to set the actor density to 2000 and for gravity i use acceleration downward on the actor 200 point. The actor still didn't follow the platform.
@FViMagination
I have tried that too before. But everytime player actor collide the platform, it's being warp into the center of the platform and follow the platform movement, because both the actor and platform (self.position x) is 0 value. But my platform has 125 pixel width, and the actor can land on any side of the platform. I want to makes the actor when land on any side of the platform, it's still stand on position (x) where the actor collide with the platform and follow the platform movement. Any idea?
thx for the reply
My platform values:
movable,fixed rotation, density 100, friction 3, bounciness 0
main actor:
movable, denstiy 1, friction 3
My platform uses interpolate moving, but tested with move and work too
Thx
I've figure it out just now and now it's working just fine. My stupid mistake, because for the platform movement i use constrain attribute to sin.(self.Time*100)*30+500. It's really move, but the fact it's only looks that it's moving, but it's not moving at all. that's why the actor stay still in that position. I change to move behaviour and the actor follow it just fine
Thx