- Home /
I can't move my player ball in game mode in Unity.
Hey There,
Yes, I am a rookie on Unity game engine but to me, this problem is strange, and it is even stranger because I have been following a tutorial of how to make a Roll-A_Ball game. http://unity3d.com/learn/tutorials/projects/roll-a-ball/moving-the-player
In this instance, I have attached a Csharp script, following the examples of the tutorial video to make my ball move on the groundplane.... However, for whatever reason, I can't move the ball in game mode. I don't think there are spelling mistakes in the script either. Here is the attached image to see my working situation. I have been using the variable of rigidbody. Add Force, using the Input.Get Axis to control the ball's movement.
If anyone can help, especially since I am still a low rank question user, then I would be super grateful and also help others if they had a similar problem too.
Many Thanks,
Daniel
Answer by kaka24fan · Aug 17, 2014 at 11:31 AM
Are you sure you set speed to some value?
Hey $$anonymous$$aka24fan
When you mean set the value, I should actually put in a fixed float number in the script? In the tutorial (you can skip to almost the ending) I copy the script directly from the video, and he make the speed a public class for anyone to set the speed at any default in the inspector.
I hope this make sense, and thank for the suggestion so far :)
If you assigned a value to speed in the inspector it should be fine, you shouldn't have to put a value in the script. Deltatime is the time in seconds that it took to complete last frame. $$anonymous$$aybe it's about 1/60 and the vector gets too small for the movement to be noticable? Try to set speed to a very large number, or put this in the code:
Debug.Log("Speed: "+rigidbody.velocity.ToString());
It should write to the console what your speed is. If it's 0 without any decimals than something else is wrong.
Hey $$anonymous$$aka24fan.
Thank you so much!
I gave this ago and it solve most of the issues, I also had to correct some of the Input buttons within the Input $$anonymous$$anager. The Debug help things! I am super grateful for this, it means a lot to a learner like me ahaha! :D
It also means a lot to me, I've started learning game program$$anonymous$$g just this summer and this is the first time I managed to help somebody, that's a good feeling!
Good luck in the future, cheers!
Your answer
Follow this Question
Related Questions
Tornado Twins level 5 fireball 1 Answer
Question about Unity_Scripting_Tutorial.pdf 2 Answers
What am I missing in Lego Micro Game Tutorial 4 Task 12? 0 Answers
Scrolling using button? 0 Answers
character lives 3 Answers