I have a group of objects that I allow my player to toss around the scene in zero gravity. However I want to create type of invisible bounds after a certain height. So far when the object reaches a certain upward bounds, I have been doing this in my FixedUpdate...
GetComponent<Rigidbody>().velocity = GetComponent<Rigidbody>().velocity - Vector3.Project(GetComponent<Rigidbody>().velocity, transform.up);
...which works in a sense, but because it is using transform.up, it is removing velocity from both upwards and downwards movement, and I need to restrict it to just upwards movement. Is this possible?
question from:https://stackoverflow.com/questions/65847997/how-to-prevent-upward-rigidbody-velocity