Hello, Im making tank shell but without rigidbody and I am updating its position through script.
I need example of calculations for mass, drag, velocity, position (gravity…)
Hello, are you use CharacterController ?
if then you can use this :
// 3D based,
public CharacterController CC;
private float gravity = 0;
//in start
if(CC == null)
CC = this.gameObject.GetComponent<CharacterController>();
//in update
// gravatity
if (CC.isGrounded)
{
velAir = velAir - (gravity * Time.deltaTime);
// if you have more factor then you can multiplay it
velAir = velAir - (gravity * mass * Time.deltaTime);
}
// when the tank in the ground and have velAir , need to set zero,
if (CC.isGrounded && velAir < 0 )
{
velAir = 0f;
}
// Drag, speed is float, drag is float
velHorizontal = input.horizontal * speed * drag * Time.deltaTime);
velVertical = input.vertical* speed * drag * Time.deltaTime);
// CC.Move(....);
Hope it Help,
You don’t have mass, drag and gravity if you are not using a rigidbody. You basically have an object that doesn’t have any physical attributes other than its dimensons.
The only thing you could calculate would probably be the velocity since that is just distance/time.
Go into some more detail about what you are trying to achieve with these information, and about your setup. If you want people to take time out of their day to help you with your issues for free, at least take some time out of your day to provide as much useful information as possible to help us answer your question.