How to create a platform that is movable (and not!)
Cap
Member Posts: 225
Hi,
imagine you have an actor that is jumping on a platform. You don't want this platform to fall down because of the actor jumping on it. So you would deactivate the movable attribute for the platform actor.
But on the other hand you want the platform to rotate slightly, so the movable attribute needs to be set.
a, How to prevent the platform from falling down when another actor is jumping on it?
(my only idea was to decrease the density of the jumping actor and increase the density of the platform actor)
b, If the platform actor rotates, the actor standing on it is jumping when he stands on the left or right side (probably because of the density difference of both actors). I want this actor to slide down the platform if the platform rotates, this works. But I don't want him to jump. (I already set the Restitution of both actors to zero).
How to do that?
Any ideas? Thanks in advance for helpful comments.
imagine you have an actor that is jumping on a platform. You don't want this platform to fall down because of the actor jumping on it. So you would deactivate the movable attribute for the platform actor.
But on the other hand you want the platform to rotate slightly, so the movable attribute needs to be set.
a, How to prevent the platform from falling down when another actor is jumping on it?
(my only idea was to decrease the density of the jumping actor and increase the density of the platform actor)
b, If the platform actor rotates, the actor standing on it is jumping when he stands on the left or right side (probably because of the density difference of both actors). I want this actor to slide down the platform if the platform rotates, this works. But I don't want him to jump. (I already set the Restitution of both actors to zero).
How to do that?
Any ideas? Thanks in advance for helpful comments.
Comments
You need to constrain the X and Y of the platform to the platform's original position. Create two attributes in the platform, origX and origY. Set those to Position.X and Position.Y
BTW, that is also how you would create a stationary propeller or windmill...
Different densities are a good way to control the player vs. the platform.
As far as not being able to jump, you'll need to check things like angular velocity, rotation, - things like that in the platform. If they are not at acceptable values, don't let the player jump.
Here you got me wrong: I don't want the player actor to jump, I don't even have a jump rule in the game project. It's just so when the player actor is on the rotating platform, let's say he is on the left, and the platform is fastly rotating clock-wise, the player actor is automatically jumpiing away (physics). If the platform is rotating slowly, the player actor is sliding down on the platform. This is the way I want it. I just want the actor to slide, but not to jump away. I tried it with different densities, but this doesn't seem to be the solution. :-/
It's not really good, but it's working.
You're just going to have to monkey with it until you get something you like.
You can try friction, drag, those types of things...