Sunday, October 25, 2020

Unity #002 - PlayerController script (probably part #01)

There are many methods of coding a player movement. I wrote down two of them (the most convenient ones for my solution). Reminder here - I've been learning Unity for a short period of time so probably there are plenty better methods to do the PlayerController script for this solution :)

The first method is using Unity function AddForce

 

 to a myRigidbody I've added force by Vector2. It will move acc. to forceFactor value

A second method it is function MovePosition


Here there is no physics (no forces) added. I just added vector value to the current position.

No comments: