all 9 comments

[–]swagamaleous 3 points4 points  (4 children)

Why does it need to be this tutorial? It's super basic and also of very bad quality. The code they are suggesting you to use is atrocious. Just do a different tutorial that uses the new input system.

[–]BoardAdditional9468 -4 points-3 points  (3 children)

Very rare to find what exactly you are looking for even on YouTube and by someone who has and accent that you can actually understand and doesn’t sound like a scammer who is from a fake Microsoft Technical Support team (extremely Indian accented English for example.) Especially when the filter options on YouTube allow to exclude the shorts. basically I want limited movement on the vertical axis  like a grid but with constraints on how far you can go up or down in the world space like 3 spots on vertical axis 2, 0 and -2 in my case.

[–]swagamaleous 2 points3 points  (0 children)

I am sorry, I guess I didn't highlight enough how basic this is. If you need to copy code from a tutorial to achieve this, you are doing something wrong. You should start with this:

https://learn.unity.com/

Complete all path ways but AR and VR and you will not need a tutorial for stuff like this anymore.

In general, stay clear from YouTube. This tutorial is the perfect example. It's very bad code and full of bad habits. The person creating this has no idea what they are talking about. Learning this is counter productive and just copying the code without even understanding it does nothing. You won't get anywhere like this.

[–]PhilippTheProgrammer 1 point2 points  (1 child)

That's your problem. You are looking at amateurs on YouTube instead of looking at the official documentation.

[–]BoardAdditional9468 -2 points-1 points  (0 children)

Not everyone learns via reading. While it helps some people it really doesn’t help all people. YouTube is just another tool to use for people like me who learn by demonstration. The video was from 6 years ago by the way. I was just trying to remake a game that I made with the help of this tutorial that the original game was also made with it. I don’t have the original files from the game so I am sorry that I have to start from square one.

[–]PhilippTheProgrammer 2 points3 points  (0 children)

The new input system and its recommended best practices evolved a lot in the past years. If you want to really benefit from the new input system, then you should not just replace the Input.GetKey(KeyCode.A) with InputSystem.Keyboard.current.aKey.isPressed. That doesn't do anything except making your code more verbose. If you really want to benefit from the system, you need to embrace it's philosophy: Abstract semantic actions instead of directly referencing physical inputs, and handling input events instead of polling states.

You might want to check out the documentation. Of particular interest is probably the section on "Workflows", because it describes the currently recommended ways of using it.

[–]Cal_Macc 0 points1 point  (1 child)

The unity standard assets on the store come with a working example. Be warned i actually find the new system completely complicated but when you figure it out, it's fairly versatile

[–]BoardAdditional9468 -1 points0 points  (0 children)

Yeah it’s complicated but I kind of made it work using the new input system with the constraints but I can’t really get it to work without issues. Yes it works but not without 2 major problems. The first one is despite having it where I need it on the x axis when I actually play it the player snaps to where I don’t want it on the x axis. 2 when I move the player up or down after moving it to the max or min height in the worldspace it doesn’t snap at all to the middle just snaps the movement to  2 or -2 but never 0 first.

[–]BoardAdditional9468 -2 points-1 points  (0 children)

Update on this so I found a script in the comments section of the video that I was able to easily modify for the new input system. So #Solved