#use pastebin bozo

1 messages · Page 1 of 1 (latest)

hearty quartz
#

use pstebin

dense charm
hearty quartz
#

pastebin

dense charm
#

What's that

sacred nest
#

c un truc pour copier du code et ça permet d'avoir le nombre de lignes les fonctions et les classes colorées (je pense que tu es français vu les commentaires de ton code)

#

bon, je sais pas si tu as mal copié ton code mais j'ai l'impression que tu étais bourré en l'ecrivant

#
using System.Collections.Generic;
using UnityEngine;

public class CharacterMotor : MonoBehaviour
{

    // Animation du perso
    Animation animations;

    //vitesse de déplacement
    public float walkSpeed;
    public float runSpeed;
    public float turnSpeed;

    //input
    public string InputFront;
    public string InputBack;
    public string InputLeft;
    public string InputRight;

    public Vector3 jumpSpeed;
    CapsuleCollider PlayerCollider;

    void Start()
    {
        animations = gameObject.GetComponent<Animation>();
        PlayerCollider = gameObject.GetComponent<CapsuleCollider>();


    }

    void Update()
    {
        //si on avance
        if (Input.getKey(InputFront)){
            transform.Translate(0,0, walkSpeed * Time.DeltaTime);
            animations.Play("walk");
        }
        //si on recule
        if (Input.getKey(InputBack)){
            transform.Translate(0, 0, -(walkSpeed / 2) * Time.DeltaTime);
            animations.Play("walk");
        }
        //rotation a gauche 
        if (Input .GetKey(InputLeft)){
            transform.Rotate(0, -turnSpeed * Time.DeltaTime, 0) 
        }
        
        //rotation a droite 
        if (Input .GetKey(InputRight)) 
            transform.Rotate(0, turnSpeed * Time.DeltaTime, 0)
        }
    }
}