Rotating platform
Eminem
Member Posts: 667
I have an actor and i want when the actor goes on the platform, if the actor goes over to the left i want it platform to swing to the left and if the actor goes to the right of the platform, then the platform swings to the right,
Anyone know how to do this?
thanks
Anyone know how to do this?
thanks
Comments
You will have to make a local variable in the platform that checks on the characters X position in relation to the platforms self.Position.X
Something like if X_Position of character > self.Position.X and platform overlaps or collides with character then do X
You could make the platform variable global but then if you have more than one of the same platforms they will all move when your character goes over to the left or right.
Darren?
i mean swinging left and right, sort of like in the game Red Balls Of Goo ( I truly enjoy your games)
But i dont fully understand what you mean, can you please be more detailed
Thanks for your help.
Darren.
In the platform you want to rotate:
Add a real attribute and call it StartY
Then do change attribute StartY to self.position.Y
Then do..Constrain self.position.y to StartY (this stops it falling)
In the physics part of actor make it movable and leave fixed rotation unchecked.
I thought you meant this when i 1st read it so added it to the template.
Darren.
Darren this is what im talking about
how did you do it?
Darren.
Darren.