1
\$\begingroup\$

I was making several games. I don't understand when I should use addTorque instead of rotate. AddForce instead of position

The latest game was a pinball game. I wasn't sure the best way to active the flippers.

\$\endgroup\$
1
  • \$\begingroup\$ pinball will most likely use gravity, from there its very likely to use physics to move the ball around and resist that gravity in some way. on the other hand if you just want to grab an object with a humanoid character and put in a diffrent location transform is what you will use as you just relocate an object in the world space, if you would like to be able to kick that object with X force so it'll move Y distance, you will have to use Physics. \$\endgroup\$ Commented Jun 21, 2016 at 11:04

2 Answers 2

2
\$\begingroup\$

When you are dealing with AddForce and AddTorque, you are simulating physics. You are utilizing the RigidBody component of your physics engine. Do you require a physics engine for your game? Or do you want to fake the physics yourself?

You cannot apply forces to a transform. You also don't need to have a RigidBody component on your gameobject in order to move it. If you are are moving your gameobject via its transform, then you are no longer simulating the physics. You will need to do a lot of the work yourself.

This depends entirely on your game. In your pinball example, it would make sense to put your paddles on a Hinge Joint and turning on the motor at a very high value in a burst, in order to swing it in the open position. Doing a pinball game without utilizing the available physics engine would be pretty silly in my opinion.

\$\endgroup\$
1
\$\begingroup\$

Adding force means you are simulating some degree of pysical movement.

Do not play with vector(force) if you do not need to simulate physical property in your game.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .