- Home /
Simple Crate pushing..
Im having a Brain Freeze... Just trying to bump into a crate and have it move... cant understand what Ive done wrong, even though Ive done it many times before!
Created new Project, using basic First Person Controller, added Ridgid body to a cube... Isnt that supposed to be it?? Anyway, its colliding (Player bumps into it) but I cant get it to move with physics..! Im sure Ive done this a hundred times before... forgetting something!!
Mark
Answer by robertbu · May 13, 2013 at 08:42 PM
A character controller doesn't use physics. Usually this is good thing since your character doesn't go flying every time he moves over a rough patch of ground. But it means that you have to explicitly move things you bump into. See OnControllerColliderHit(). The example script there is what you are looking for.
This worked... funny.. Im so certain I didn't have to do this before... anyway thanks.. did the trick!
Answer by markfrancombe · May 14, 2013 at 08:41 PM
Im just going to add MY OWN ANSWER here, as I have found the correct one. Although the code that robertbu directed me to worked fine, I had the nagging feeling that the solution was simpler.
The truth is that I simply had STATIC selected on the crate/box.
So EVEN IF a character controller doesn't use physics, its NOT true that it doesn't have collisions, Simply add a Redid body to the thing you want to knock about, check that static is turned OFF, and bump into it to your hearts content! No Scripts no nuffing!
:)
Mark
Your answer
