Character Controller Unity – Movimiento Basico

Character Controller Unity – Movimiento Basico

Como usar el Character Controller y mover a tu personaje en Unity 3D 2018!!
En este video aprenderemos a mover a nuestro jugador usando el componente Character Controller de Unity.
Nos centraremos en el movimiento básico y poco a poco iremos ampliando sus movimientos en próximos videos.

No te pierdas esta serie de tutoriales en los que aprenderemos juntos a utilizar el motor Unity 3D y crearemos nuestros propios videojuegos!

Script PlayerController:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour {

    public float horizontalMove;
    public float verticalMove;
    public CharacterController player;

    public float playerSpeed; 

	// Use this for initialization
	void Start () {
        player = GetComponent<CharacterController>();
	}
	
	// Update is called once per frame
	void Update () {

        horizontalMove = Input.GetAxis("Horizontal");
        verticalMove = Input.GetAxis("Vertical");
		
	}

    private void FixedUpdate()
    {
        player.Move(new Vector3(horizontalMove, 0, verticalMove) * playerSpeed * Time.deltaTime);
    }
}

Descarga los archivos del proyecto aqui: Script

5 comentarios en “Character Controller Unity – Movimiento Basico”

  1. Primero que nada Gracias por compartir tus conocimientos, todo está muy bien explicado.

    presento el siguiente problema, en la consola aparece este error respecto al script ‘CharacterCotroller’

    Assets\Scripts\CharacterCotroller.cs(26,16): error CS1061: ‘CharacterCotroller’ does not contain a definition for ‘Move’ and no accessible extension method ‘Move’ accepting a first argument of type ‘CharacterCotroller’ could be found (are you missing a using directive or an assembly reference?)

    sabes como puedo solucionarlo? de verdad

  2. ayudaaa no funciona el personaje no se mueveeeee estees mi script
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class PlayerController : MonoBehaviour {
    public float horizontalMove;
    public float verticalMove;
    public CharacterController player;
    public float playerSpeed;
    // Use this for initialization
    void Start () {
    player = GetComponent();
    }

    // Update is called once per frame
    void Update () {
    horizontalMove = Input.GetAxis(“Horizontal”);
    verticalMove = Input.GetAxis(“Vertical”);

    }
    private void FixedUpdate()
    {
    player.Move(new Vector3(horizontalMove, 0, verticalMove) * playerSpeed * Time.deltaTime);
    }
    }

  3. ayuda no se mueve el personaje este es mi script:using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class PlayerController : MonoBehaviour {
    public float horizontalMove;
    public float verticalMove;
    public CharacterController player;
    public float playerSpeed;
    // Use this for initialization
    void Start () {
    player = GetComponent();
    }

    // Update is called once per frame
    void Update () {
    horizontalMove = Input.GetAxis(«Horizontal»);
    verticalMove = Input.GetAxis(«Vertical»);

    }
    private void FixedUpdate()
    {
    player.Move(new Vector3(horizontalMove, 0, verticalMove) * playerSpeed * Time.deltaTime);
    }
    }

Deja un comentario