Search Unity

[Space Shooter] Problem With The PlayerController Script

Discussion in 'Scripting' started by ArselienGaming, Aug 21, 2018.

  1. ArselienGaming

    ArselienGaming

    Joined:
    Aug 9, 2018
    Posts:
    1
    Hi everyone, I'm new to Unity and I have a problem with the script of my PlayerController. Here it is :
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class PlayerController : MonoBehaviour {
    5.  
    6.     void FixedUpdated () {
    7.         float moveHorizontal = Input.GetAxis ("Horizontal");
    8.         float moveVertical = Input.GetAxis ("Vertical");
    9.  
    10.         Vector3 movement = new Vector3 ( moveHorizontal, 0.0f, moveVertical);
    11.         Rigidbody rigidbody = GetComponent<Rigidbody>();
    12.         rigidbody.velocity = movement;
    13.  
    14.     }
    15.  
    16. }
    There is no error displayed in the console but when I click on the Button: Play, absolutely nothing happens, I can not move my character. Help me please

    For information : I code with C# and i am using the 5.6 unity version
     
  2. GroZZleR

    GroZZleR

    Joined:
    Feb 1, 2015
    Posts:
    3,201
    FixedUpdate not FixedUpdated
     
  3. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Debug.Log would have likely exposed the issue...