Jumping on a moving platform - problem

#1

Welcome blender and armory3D community!
I have a problem using nodes, and need some help from more expirianced users. What i’m traing to do is make simple jump on a moving platform with a trigger(activate/deactivate parent) on it. My player is a rigid body object. The problem is, when player jumps on a platform, the platform slides under its feet, unless player is moving or rotating.
Here is the platform trait:


What do You think?

0 Likes

#2

I would imagine that the best way would be to have moving platforms in a collision layer and have a raycast detecting if an object in that collision layer is just below. If it is use the set parent node with an input from get object to set the moving platform as a parent until the player jumps or falls off it.

0 Likes

#3

Hi there,
I was trying to manage the “cast physics ray” node, but i think i don’t understand it properly:( I build my prewious node setup based on the code from this tutorial (4:52).

https://www.youtube.com/watch?v=rO19dA2jksk

It was made for Unity, thats why im not sure if it will work for Armory3D as well. My final result is like the example from the tutorial (4:30). As my coding skills are still poor, maybe i just don’t see some obvious thing:(

0 Likes

#4

I think the problem is that you are trying to parent a rigid body to another object. I haven’t tried it very recently, but I’m pretty sure that rigid bodies can’t have parents and still behave properly because they are controlled by the physics engine and the parent breaks that. You would have to add a rigid body constraint if you wanted to tie the player object to the platform, but there isn’t a way to create constraints like that in nodes.

Another better possibility is to move your platform by using the Set Velocity node instead of the Translate node ( I’m assuming that is how you are doing it ). When using the Translate node, Armory moves the platform separate from the physics engine which means that the physics engine can’t evaluate its speed correctly to have you player rigid body move with it when it lands on it. A user had an issue on GitHub where movement wasn’t transferring from one object to another, and that fixed it. This would get rid of your volume trigger, too. You might need to increase the friction of the platform or the player if the player still slides off.

0 Likes

#5

Many thanks for response and explanations. I will try this, and write as soon as i get the result:)

0 Likes