Hi. I have an object in my scene(a bullet)and I wanted to make it go lower in the scene. I know how to do it,but only this way:
transform.Translate(0,-5,0);
But I wanted to make it accessing the bullet´s physics(which by the way is a rigid body physic). Oh,and sorry for my english
By lower do you mean fall toward the ground over time? If your bullet is using a rigidbody, just check the gravity box. Play with the drag value.
However, if you are going to move rigidbody’s via Translate weird things will happen.
Hi SGM3,thanks a lot for replying. Yes that’s exactly what I meant,but I wanted to do it through coding,more specifically in Javascript language
Try something like this.
rigidbody.AddForce(bulletTransform.up * -bulletGravity);
Where bulletGravity is a public variable that serves as either a scaler for the bullets vector.