- Home /
Unity 5 - Can't move/control object
Hello,
If I open a project from Unity 4.6 in Unity 5 I can't control my object anymore. I also created new project in Unity 5, set a scene with some ground and object (cube) that I want to move with my keyboard keys. I attach script to object and start the scene but object is not moving. Same thing is working in Unity 4.6.
Script is very simple:
using UnityEngine;
using System.Collections;
public class Move : MonoBehaviour {
public int speed = 0;
private Vector3 input;
void FixedUpdate(){
Vector3 input = new Vector3(Input.GetAxis ("Horizontal"), 0, Input.GetAxis("Vertical"));
GetComponent<Rigidbody>().AddForce(input * speed * Time.deltaTime);
}
}
I'm not using any kind of animations in my project.
EDIT
I opened my Unity 4.6 and project that I'm working on (project was not opened with Unity 5), and now even there I can't move my object. Maybe some conflict betwen Unity 4.6 and Unity 5?
EDIT2
I unistalled Unity 5 and now I can't make object to move even in Unity 4.6. Like it is glued to ground, I can see some force added to object (it shakes a little on top).
If it's shaking then the script is working. Did you try increasing the speed or decreasing the mass of the rigidbody?
Answer by studentvz · Mar 30, 2015 at 06:21 AM
SOLVED For some reason my timescale was set to 0 (not in code), after setting it to 1 in Start function everything is ok.
Your answer

Follow this Question
Related Questions
Click object to move player/object 1 Answer
Change colour from random to constant? 1 Answer
How can I fix the Unity Remote 5 blurry problem? 2 Answers
UI covering my Sprite 9 Answers
Text Mesh Pro - Underlay problem 1 Answer