Quantcast
Viewing latest article 24
Browse Latest Browse All 90

Answer by Matt-Downey

I'm almost positive transform.Translate is cheaper than rigidbody.MovePosition. If you use rigidbody.MovePosition, the object will sweep out the space afaik to make sure the object interacts with all of the other objects in it's path. If you wanted realism in a sea of soccer balls for example, MovePosition would probably push the objects in front of you outwards in waves through physics (with a little extra overhead), whereas transform.Translate would push them out of the position to which the player teleported (not moved), which could make the soccer balls behave more erratically as the player reached higher speeds. Also, If I'm not mistaken, rigid.MovePosition will not move to the position it is told to move to per se. In reality rigid.MovePosition will try to move to a position, but if it's path is blocked it will try to get as close as possible. transform.Translate will probably be cheaper, since it is a form of teleportation that doesn't use physics at all. The rigidbodies interact with colliders and physics more than the transform afaik. For instance, rigidbody has a SweepTest function, which determines the first collision between an object and its environment if it were moved. The transform class on the other hand has no such functions. So yeah: rigidbody-->physics; transform-->teleportation [edit:] and since you are using CharacterController.Move that is going to be even more expensive than physics in most likelihood, since it has to calculate everything related to move in the CharacterController script and then perform physics.

Viewing latest article 24
Browse Latest Browse All 90

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>