Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

perdonen las molestias pero hice lo mejor posible tengo 9 años ;( por cierto es lo mismo

Discussion in 'Scripting' started by benixd022, Sep 12, 2022.

  1. benixd022

    benixd022

    Joined:
    Sep 11, 2022
    Posts:
    11
    using System.Collections;
    using System.Collections.Generic;
    using System.Diagnostics;
    using UnityEngine;

    [RequireComponent(typeof(CharacterController))]
    public class PlayerController : MonoBehaviour
    {
    public float walkSpeed = 5f;
    public float runSpeed = 10f;
    public float jumpHeight = 1.9f;
    public float gravityScale = -20f;

    Vector3 moveInput = Vector3.zero;
    CharacterController characterController;

    private void Awake()
    {
    characterController = GetComponent<CharacterController>();
    }

    private void Update()
    {
    Move();
    }

    private void Move()
    {
    if (characterController.isGrounded)
    {
    moveInput = new Vector3(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical"));
    moveInput = Vector3.ClampMagnitude(moveInput, 1f);

    if (Input.GetButtonshift("Sprint"))

    Debug.Log("Sprint");
    {
    moveInput = transform.TransformDirection(moveInput) * runSpeed;
    }
    else
    {
    moveInput = transform.TransformDirection(moveInput) * walkSpeed;
    }

    if (Input.GetButtonDown("Jump"))

    Debug.Log("Jump");
    {
    moveInput.y = Mathf.Sqrt(jumpHeight * -2f * gravityScale);
    }
    }

    moveInput.y += gravityScale * Time.deltaTime;
    characterController.Move(moveInput * Time.deltaTime);
    }
    }

    posdata: me salieron 999+ por las teclas que me pone CS1513 xd
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,945
    While I appreciate that English is not your chosen language, this IS an English language forum.

    This is also the second time I have told you how to use code tags.

    If you post a code snippet, ALWAYS USE CODE TAGS:

    How to use code tags: https://forum.unity.com/threads/using-code-tags-properly.143875/

    You may edit your post above.
     
  3. benixd022

    benixd022

    Joined:
    Sep 11, 2022
    Posts:
    11
    not speak inglish?
     
  4. Nad_B

    Nad_B

    Joined:
    Aug 1, 2021
    Posts:
    373
    She's/he's 9 years old.


    Usar "Google Translate". Lo usé para escribir esto. Funciona bien.
     
  5. benixd022

    benixd022

    Joined:
    Sep 11, 2022
    Posts:
    11
    aaaaaaaaaaaaaaaa ok xd
     
  6. benixd022

    benixd022

    Joined:
    Sep 11, 2022
    Posts:
    11
    yes eeee not speak inglish is real tengo 9 años irou no escribir en inglish