Animation collision

Hey guys,

I’m new to Unity( glad to have a forum :slight_smile: ) and have a problem with an animation I created.
It’s just a cube going up and down in a loop. But as I jump on it and it goes up my character falls after ~ 1 sec through the cube.
The other cubes( same as the animated) working well without animation but the animated one has this collision problem.

Do I need a script for that or just change/add some components?

Sincerly,
ElGreco

#edit: I notice that I only fell through it when I dont move.
#edit2: I know that there are multiply same questions but I’m still too stupid to figure out the solution

Ok, after I read a while here I can see that this is a popular question, but I just can’t be able to solve the problem…
Here is my movement script, maybe it helps.

ofc I dont want you to rewrite or correct it for me, but maybe you can say if its completly wrong or smth

Hello, is your platform cube’s rigidbody marked kinematic (using the isKinematic checkbox) ?

  • Kinematic objects can be moved by changing their transform position (as you’re currently doing), and do not react to forces application (but they can apply forces to other objects through collision).
  • Non-kinematic objects do react to forces application, but they must not be moved by altering their transform directly. You have to use Rigidbody.AddForce or Rigidbody.AddTorque to move them.

One possible cause to your problem is that you’re changing the transform of a non-kinematic object directly.

As for the question you ask in your code comments (is MyGameObj() useful ?) the answer is definitely NO ! Update() is called each frame, that happens typically 50 times per second. You don’t want to instantiate ( = create in memory) a new character 50 times per second. You normally have only one character that moves each frame, but you don’t want to create hundreds of them.