Hi!
In my game the player controls a hovering tank,
it is third person.
I use particles to make the hovering jets of fire.
since its a tank I am using a box collider instead of a character controller.
it has a kinematic ridgedbody attached (kinematic because the force of the particles make it go flying in random directions), to make it collide with things, but so far it doesnt work right.
-when it goes off the terrain it dosn’t fall
-It goes right through hills in the terrain
and nomater the size or mass of a ridgebody in the world, it pushes it out of the way, also it goes right through ather objects!! meaning as of now, nothing can stop the player from going anywhere!
How can I fix this?!!
thanks in advance!
This problem is actually the result of using a kinematic rigidbody. The kinematic setting means that the object is not affected by physics and can be placed anywhere you choose to move it. Other objects may, however, be affected when it collides with them.
To get correct physical behaviour, you should switch the isKinematic setting off and use forces to control the tank. If you found that doing this made the tank fly off randomly, then it probably means the script or its settings are not right. Can you post the script you are using for the tank (or post a link if it is publicly available somewhere)?
thanks for the reply!
when i first tested the tank with the script it worked fine, but when I added the particles (four pillars of fire undrneath the tank, and some smoke aswell) it would fly off in random loops ad turns.
is there someway to turn off the world force off the particles, i have the world velocity at 0 on all of them, but that doesn’t seem to make a difference.
here are the tank controls so far
var speed = 8.0;
var rotateSpeed = 3.0;
function Update ()
{
transform.Rotate(0,Input.GetAxis ("Horizontal") * rotateSpeed, 0);
transform.Translate(0,0,Input.GetAxis("Vertical") * speed * Time.deltaTime);
}
there is also a script for the turret rotation.
what am I doing wrong?
thanks!
The force parameters of the particle system don’t have any effect on rigidbodies and likewise rigidbody forces don’t directly affect particles. If the particles are flying around in random directions, it’s likely that you have non-zero values in the Rnd Force property. Make sure that the X, Y and Z values of the random force are zero and see if the result improves.
I found out the problem was I had forgotten to remove the character controller from the tank!
stupid mistake
thanks for all your help thow!