- Home /
How to make your character move?
This is my first time making video games and I decided to use unity because mainly it was free. I am learning about terrain but my main problem is how to make the character your using move and how to make the camera follow him/her. Can someone help me out and explain it very simply because like I said this is my first time?
There is a prefab called "First Person Controller" inside Unity, search "First person Controller" in the project panel and drag it into the scene view, and play the game.
thank you that really helped me too because I am new to unity
Thanks used this and it worked great added some up and down code as well.
Answer by Wentzel · Nov 02, 2011 at 08:48 PM
var MoveSpeed : int = 0.5;
function Update () {
if(Input.GetKey(KeyCode.UpArrow)){
transform.Translate(Vector3,MoveSpeed,0,0);
}
}
I couldn't test it as i'm using my phone. This is just a simple way of moving your object if you change "Translate" into Rotate you can well rotate your object.
i'm new myself :P
I would reccomend http://www.unity3dstudent.com/ site since your new and is a great place to start.
Answer by Penaloza12 · Jul 28, 2015 at 09:51 PM
This should work for you. this is a using UnityEngine; using System.Collections;
public class Movement : MonoBehaviour {
public int movementspeed = 100;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKey (KeyCode.A)) {
transform.Translate (Vector3.left * movementspeed * Time.deltaTime);
}
if(Input.GetKey (KeyCode.D)) {
transform.Translate (Vector3. right * movementspeed * Time.deltaTime);
}
}
}
Answer by ThePussyCat · Mar 21, 2017 at 08:48 AM
You can also use this for moving an object.
float movSpeed = 7f;
void Update {
transform.Translate (new Vector3 (Input.GetAxis("Horizontal")*movSpeed*Time.deltaTime), 0, Input.GetAxis("Vertical")*movSpeed*Time.deltaTime));
}
Thank you for this, you help me figure something out I was struggling with.
Answer by CreativeStorm · Nov 02, 2011 at 08:48 PM
Youtube can become a good friend to you learning Unity - there are lots of tutorials ;) a quick search brought up this: http://www.youtube.com/watch?v=od78RhlLXUI&feature=related
there are much more and maybe some better - watch a couple of them will point you the right direction.
you can find tutorials everywhere on the web most are really simple, quick and nice to get familiar with Unity ;) Ask google.
It is very useful to make my charterer move yes it is exactly right concept, share good stuff with good ideas and concepts, lots of great http://superiorpaper.net/dissertation-help information and inspiration, both of which I need, thanks to this concept.
Answer by rebeccahickshq · Sep 16, 2017 at 01:10 AM
I appreciate it!. I really like it when people get together and share ideas. Great website, continue the good work!. Either way, great web and I look forward to seeing it grow over time. Thank you so much. http://supersmashflash-2.com |=>super smash flash 2 http://bloonstowerdefense5game.com |=>bloons tower defense 5