Комментарии:
Hey everyone!!
I have recently discovered that 2D vector composite has been changed slightly in later versions of Unity
In this tutorial I am using 2020.3.8f1..
In order to do the same thing.. you will need to change some of the properties of the Movement action...
So with the Movement action Selected:
- In the the Properties tab
- Change the 'Action Type' to Value
- Change the 'Control Type' to Vector 2
Now you will be able to right click on the Movement action and Add an Up/Down/Left/Right Composite!
Hope this helps! 😃
Also I left it out of the video but if anyone is having trouble implementing crouch and sprint, you need to define some extra properties for these at the top of your PlayerMotor script
lerpCrouch, crouching, sprinting -> bool
crouchTimer -> float
i am using version 3.4.1 and th 2d vector thing does not come up 4 me
Ответитьi had some problems while doing it but with the help of comments everything works, very happy with ur tutorial m8
ОтветитьOkay, so i know how to make my character start running and croaching, but what about dashing? How would be the code?
ОтветитьI got sprint working but I want it to sprint on hold, not be toggle. Anyone have a fix?
Ответитьit says there is an error for OnFootActions and OnFoot
ОтветитьHello I like your all tutorials but in fps episode 2 you made the gate so can make in your tutorials Plz
ОтветитьI encountered these two errors at the end of coding the Look function:
" error CS1061: 'Camera' does not contain a definition for 'Transform' and no accessible extension method 'Transform' accepting a first argument of type 'Camera' could be found (are you missing a using directive or an assembly reference?)"
and
"error CS1061: 'PlayerInput.OnFootActions' does not contain a definition for 'Look' and no accessible extension method 'Look' accepting a first argument of type 'PlayerInput.OnFootActions' could be found (are you missing a using directive or an assembly reference?)"
Can anyone help?
this vid is a scam 2D vector dosent exiest
ОтветитьI did everything right but I cant look up or down
ОтветитьHello, I have the PlayerMotor script but I get this error: Assets\Scripts\PlayerMotor.cs(10,13): error CS0246: The type or namespace name 'PlayerMotor' could not be found (are you missing a using directive or an assembly reference?)
here's my script;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class InputManager2 : MonoBehaviour
{
private PlayerInput playerInput;
private PlayerInput.OnFootActions onFoot;
private PlayerMotor motor; // Assuming you have a PlayerMotor2 script
// Start is called before the first frame update
void Awake()
{
playerInput = new PlayerInput();
onFoot = playerInput.OnFoot;
motor = GetComponent<PlayerMotor>(); // Make sure to use the correct PlayerMotor class
}
// Update is called once per frame
void FixedUpdate()
{
// Tell the player motor to move using the value from our movement action.
motor.ProcessMove(onFoot.Movement.ReadValue<Vector2>());
}
private void OnEnable()
{
onFoot.Enable();
}
private void OnDisable()
{
onFoot.Disable();
}
}
It would be nice if you can explain the classes, methods, and API's you're using, why you're doing it, and a higher level understanding. I get it cause I've been doing this for a long time, and it's fairly straightforward, but it's a bit quick from a viewer perspective.
ОтветитьThe player motor part is not working for me
ОтветитьThe 2d vector input is not theare
Ответитьcan someone help my camera lag when i crouch
Ответитьmy jump is not working
Ответитьgetting error the type name '.onfootactions' does not exist in the type 'playerinput'
Ответитьwhen i tried making the jump the player would be in the air until the player velocity was -2 and it was slow going down
ОтветитьGreat tutorial, I wasn't even making a shooting game
Ответитьi would like some help when i entered the inputmanager code i encountered this issue called Assets\Scripts\Inputmanager.cs(4,30): error CS1002: ; expected please reply for help
-TY
I am. Stuck on the last line of code. look.ProcessLook(onFoot.Look.ReadValue<Vector2());
For some reason it’s telling me that “Look” has no previous definition, despite my code looking the same as his. Does anyone have any advice? 🧎
my jumping dosent work
Ответитьmy jump thing is not working, can anyone help
Ответитьbro that import action is not showing in input folder I rechecked every thing but not showing that pls solve my problem i am beginner pls anyone tell me 😔😔
Ответитьi have a problem in the jump when i press space bar the player doesn't jumping btw my input action are right can someone help me to fix that
ОтветитьHi, very helpful tutorial, but I have one problem, And it seems that the character can jump indefinetly
How can I solve this, also, how can I make it to make the character be able to later have a doble jump hability?
thankyou for this. Wondering what theme you are using in your VS editor?
ОтветитьAnyone know a fix to The type 'PlayerInput' already contains a defination for 'OnFoot'
Ответитьthis was so, so helpful, thank you! i had no idea how to make movement and combat in my game!
ОтветитьGuys, I have a problem with my characters movements, when I press ,,W" , my character starts flying and when I press ,,S" , my character comes back on the ground, please could someone help me?
Ответитьi got errors when i put in the first c# skript
ОтветитьMy code is saying that onfootActions does not exist in player input
ОтветитьWhat kind of project tho? 3D? 2D?
ОтветитьSir your tutorial cool
Ответитьwhat are you using to set up the coding ?
ОтветитьHi the code in not working for me can you help me out
Ответитьfor some reason once i press play Im unable to move the character with the move tool as he does to show that the character has no gravity. The player just keeps teleporting to where it started when i try to drag him up with the move tool.
Ответить@Natty Creations so i opened my java script in fire fox so during the input manager part i cant edit/add code so i cant do a damn thing
Ответитьso i opened my java script in fire fox so during the input manager part i cant edit/add code so i cant do a damn thing
Ответитьdoes anyone know why unity can't find Player Motor
Ответитьwheres the properties tab
ОтветитьSeems like a lot of stuff changed, getting tons of error in the code, i think the formatting is different now.
ОтветитьPlayerLook.cs:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerLook : MonoBehaviour
{
public Camera cam;
private float xRotation = 0f;
public float xSensitivity = 30f;
public float ySensitivity = 30f;
public void ProcessLook(Vector2 input)
{
float mouseX = input.x;
float mouseY = input.y;
xRotation -= (mouseY * Time.deltaTime) * ySensitivity;
xRotation = Mathf.Clamp(xRotation, -80f, 80f);
cam.transform.localRotation = Quaternion.Euler(xRotation, 0, 0);
transform.Rotate(Vector3.up * (mouseX * Time.deltaTime) * xSensitivity);
}
}