Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

AddForce or transform.Translate?

Hello. I started learning about unity's c# recently, and wanted to make a basic movement script for my character. However, I don't know which one is the best method of movement, Rigidbody.AddForce or transform.Translate. Can you guys help me?

Comments

  • ChronicChronic Member

    It generally depends on what exactly you want to do. But I'm pretty sure I've had experiences with transform.Translate having objects move through other colliders. So I would go with Rigidbody.Addforce.

  • MoodieMoodie Member

    AddForce is better for bullets due to Translate going through walls sometimes, it depends on what you are doing

  • MuradoMurado Member

    In order to detect collisions properly, you would have to use a Rigidbody method to move your char. So in your case AddForce.

  • BarjiBarji Member

    Depend's on the game really. I'd generally recommend using rigidbodys. You can also use RigidBody.velocity if you want to have a little more control!

  • BayszBaysz Member

    It is exactly what you want to do. Besides you should check DoTween library. You may use DOMove and get better visual results.

    http://dotween.demigiant.com/documentation.php

Sign In or Register to comment.