Answer the question
In order to leave comments, you need to log in
The character jumps onto the moving platform, and she leaves without him, what to do with him?
I am making a 3d game where my character is a cube, obeying all the laws of physics, he can jump, ride, there are moving platforms in the game, when jumping on which she leaves without him, but with him. It looks like this:
Here is the code for moving the platform:
void Update()
{
transform.Translate(0,0,speed*Time.deltaTime);
if(transform.position.z>30){
speed = - speed;
}
if(transform.position.z<10){
speed = - speed;
}
}
cub.transform.Translate(0,0,speed*Time.deltaTime);
Answer the question
In order to leave comments, you need to log in
I propose to make you an option when the character collides with the platform, i.e. jumps on it and the collision works, and when he is on it, he moves at the same speed as the platform, back and forth, and when jumping on the platform, it will feel like you are not on the platform, but when walking, just add the speed of the platform to the speed walk.
I hope I didn't make this process difficult for you.
I can be wrong, because I'm not a pro and probably not the best idea I'm giving you :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question