Cube Isn't moving

posted to: Adding Impact Force

Hi Jonathan, 

I would like to say, thanks for instructing these videos.  So I was having a similar issue with the cube not moving.  Regardless of the size, the cube still did not move.  Interestingly enough, I can see the position and rotation values of the cube changing.  I also added debugging messages just to confirm that detection worked when it hit the cube.  The sphere works perfectly fine.  I also tried with other shapes and it worked fine.  Have you come across this problem?

  • Jonathan Gonzalez(jgonzalez) replied

    If you're using the project files I believe one of the cubes was on a separate layer to show how the layer mask would work. So two of the objects would have the layer to be detected by the raycast. This is to mimic the effect of applying a force to enemy characters or objects, but ignoring other types of objects altogether. Although if you say that the values in the Transform component are changing that is a bit weird. 

    Other common issues that could be the issue is ensuring that the object has a rigidbody and a collider. The rigidbody should have "is Kinematic" unchecked. It's also possible that the force being applied to the cube isn't strong enough, so I would really crank up the force and see if it makes a difference. Outside of that I would say it would be a very unique issue. 

  • lawrenhanson replied

    Thanks for your assistance.  Increasing the force moved the cube.  All the settings in the correct position as you described in the video.  Thanks again!

  • Jonathan Gonzalez(jgonzalez) replied

    Awesome, glad I could help!