Hello,
I’m new to unity and i have to use it for a unity project but i’m at a loss with what i need to do Programmaticly i know how to do it but in unity i have no idea if what i have planned would even work and if it would how i get the properties i need.
I currently have my Ship hovering effect by using a force to offset gravity
public float HoverThrust = 9.81f;
private bool hoverPush = false;
void FixedUpdate()
{
if(HoverThrust > 9.85f || HoverThrust < 9.78f){
hoverPush = !hoverPush;
}
HoverThrust = (hoverPush)? HoverThrust+0.02f : HoverThrust-0.02f;
rigidbody.centerOfMass = new Vector3(-0.2f, 0, 0);
Vector3 centralThrusterPosition, centralThrusterForce;
centralThrusterPosition = new Vector3(
transform.position.x-0.2f,
transform.position.y,
transform.position.z
);
centralThrusterForce = new Vector3( 0, HoverThrust, 0);
rigidbody.AddForceAtPosition(centralThrusterForce, centralThrusterPosition);
}
This works and gives me a (mild)hovering effect but as you can see its using gravity force amounts to counter Gravity i want it so i counter gravity by pushing off a track below however it would need to be the track directly below the ship as there will be loop the loops and such