- Home /
Space Shooter Tutorial Player Won't move.
At lesson 5 I can't get the PlayerController.cs script to work, i can run the game , no compiler errors but also no movement; Here is my code: At lesson 5 I can't get the PlayerController.cs script to work, i can run the game , no compiler errors but also no movement; Here is my code:
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
private Rigidbody rb;
void Start () {
rb = GetComponent<Rigidbody> ();
}
void FixedUpdate () {
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.velocity = movement;
}
}
Either you haven't attached the script to the ship, or your input axes aren't correct. You can look at your input axes in, Edit -> Project Settings -> Input
Answer by Seiwert · Jan 16, 2017 at 07:44 AM
uncheck the "Is Kinematic" checkbox!! i had the same issue
Your answer
![](https://koobas.hobune.stream/wayback/20220612100942im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Restrict a Players Movement Up a Slope 1 Answer
How to make a gamebject wiggle slowly as it moves forward ? 1 Answer
Rigidbody movement conflict? 1 Answer
How to make an object moving in a certain direction, move in specific steps like 0.1f 1 Answer
Moving an object in Start() vs moving an object in Update() with Time.deltaTime 2 Answers