commit
This commit is contained in:
parent
8c84231991
commit
ae596b6e7e
1 changed files with 1 additions and 1 deletions
|
|
@ -52,7 +52,7 @@ public class Dobber : MonoBehaviour
|
||||||
void Move()
|
void Move()
|
||||||
{
|
{
|
||||||
//new Vector3 for calculating movement values
|
//new Vector3 for calculating movement values
|
||||||
Vector3 move = new Vector3(0, 0, moveVertical * 100 * moveSpeed * Time.deltaTime);
|
Vector3 move = new Vector3(0, rb.velocity.y, moveVertical * 100 * moveSpeed * Time.deltaTime);
|
||||||
Quaternion rotate = Quaternion.Euler(transform.rotation.x, moveHorizontal * 100 * turnSpeed * Time.deltaTime, transform.rotation.z);
|
Quaternion rotate = Quaternion.Euler(transform.rotation.x, moveHorizontal * 100 * turnSpeed * Time.deltaTime, transform.rotation.z);
|
||||||
//here we apply the movement related to the rotation of player
|
//here we apply the movement related to the rotation of player
|
||||||
rb.velocity = transform.right * move.x + transform.up * move.y + transform.forward * move.z;
|
rb.velocity = transform.right * move.x + transform.up * move.y + transform.forward * move.z;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue