Комментарии:
I have a question for this, while it is working in my project, what if the object the player is standing on isnt "ground"? I could assign other objects the "Ground" tag which fixes this issue, but is that really the best practice for this? I feel like this would cause other issues in the future, for example if you are playing a building game and want something to have a different tag than "Ground". It also seems that since im using the default capsule collider that I am able to double jump when going up cubes in certain ways.
ОтветитьDíky!
ОтветитьThank you so much!!!!!!!
Ответитьbanger
ОтветитьFor some reason when I tried to start it to test it wouldnt let me and kept saying something was wrong when i copied everthing down i think its cause i wasnt using a cube but Idk
Ответитьso nice finding a video that explaines what the code means instead of just giving it to me
ОтветитьHi buvesa
hmmm i got some errors it says
Assets\Scripts\MovementPlayer.cs(24, 38): error CS0117: "Vector3" does not contain a definition for foward
i am beginner so...
don't tell this anyone GIVING SUB :)))))
where do i copy and paste the code?
Ответитьplease put a button for up down left and right ...that will b much appreaciated,,,
Ответитьფოქ იუ ბიჩ
Ответитьit doesnt do anything when im coding
Ответитьit makes the text gray tho
Ответитьhow do i normalize the movement so the character doesnt move faster diagonally
ОтветитьCould you not just check if player is grounded instead of having to tag all ground in your game?
Ответитьusing System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
public float speed = 5.0f;
private float horizontalInput;
private float forwardInput;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
//get player input
horizontalInput = Input.GetAxis("Horizontal");
forwardInput = Input.GetAxis("Verical");
//move the player forward
transform.Translate(Vector3.foward * Time.deltatime * speed * forwardiput);
transform.Translate(Vector3.right * Time.deltatime * speed * horizontaliput);
}
}
this was really helpfull and made everything clear for me ty very much and keep up with good contents like this one
ОтветитьThanks your vid helped me! keep up the great work!👍
Ответитьyup your video is very helpful even in 2023
ОтветитьThank u so much
Ответить