Log in

View Full Version : Need help with character moving in Unity 3D


Castle of Glass
December 28th, 2012, 01:51 AM
before i tell you what i need help with in detail, let me tell you this straight away: I have recently gotten into making games and all of that stuff and yes i have gone through tutorials, but none can help me with this problem. Here it is:

So i am working on the coding for a character in a game i am working on. Currently the character you move around is just a cube but who cares. So i am working on getting it to move around, going forwards and turning. The cube turns flawlessly, but when ever i try and move the cube forwards, it just falls over.
here is a demonstration:
oithoX_-GJ0
(the red light is there so you can see what side it should move forward on)
To help you find the problem, here is a screenshot of the cube inspector: first half:
http://puu.sh/1GfBT
second half:
http://puu.sh/1GfC6
Here is the the coding for the movement:
http://puu.sh/1GfDC

If you need anything else to help fix this problem, just post a reply. Thank you for your time.

-niilo789

IVIodern
December 28th, 2012, 05:09 PM
Put the cube up in the air, not too high though. It may be because the cube spawns inside the 'ground' entity.

Castle of Glass
December 28th, 2012, 08:09 PM
Put the cube up in the air, not too high though. It may be because the cube spawns inside the 'ground' entity.

not that. even if it is off the plane, it will fall, hit the plane and still tip over. asked my friend who is also uses unity, gonna try what he said to do.

IVIodern
December 28th, 2012, 10:22 PM
Try adding something like
function Awake() {
rigidbody.freezeRotation = true;
}

Castle of Glass
December 28th, 2012, 11:57 PM
Try adding something like
function Awake() {
rigidbody.freezeRotation = true;
}

fixed it but adding a player controller