- Home /
Marble push crate physics fail?
I'm trying to create a marble game (where you control a marble and solve puzzles etc you know), and noticed that the physics go a bit wtf.
The crates that are supposed to lay on the ground and do nothing somehow are like one inch IN the ground. And if you try to push the crate with the marble it doesn't really want to move, causing it to sometimes fall over instead of move/slide or even ROTATE in strange directions.
If you don't get what I mean [URL="https://dl.dropbox.com/u/91253675/WebPlayer.html"]click this[/URL] to open a webplayer with my current status. Try to push a crate with the marble and notice the wtfy physics. W A S D N M do something.
Maybe I just put a simple setting in the collider options or something wrong, I posted images of the settings below.
[QUOTE=Mold;981294][URL=http://img801.imageshack.us/img801/9171/platforme.png]Platform Settings[/URL] [URL=http://img196.imageshack.us/img196/534/cratee.png]Crate Settings[/URL] [URL=http://img405.imageshack.us/img405/3183/marblee.png]Marble Settings[/URL]
Anyone knowing how to make the crates NOT stick in the ground and move properly, please help :(
Answer by Ingen · Jul 12, 2012 at 10:11 PM
Try to add force, if don't work set height the force
http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.AddForce.html
var Force : int = 10;
function OnControllerColliderHit (hit:ControllerColliderHit)
{
if (hit.gameObject.tag == "Cube")
{
Debug.Log("hit the cube");
hit.rigidbody.AddForce(Vector3.forward *Force);
}
}
Your answer
Follow this Question
Related Questions
Push object away from another object 1 Answer
Pulling objects 2 Answers
Amnesia like objects, in unity. 2 Answers
Child Colliders 0 Answers
How to set Player to push only during pushing animation 1 Answer