Just getting started with Unity and Scripting. Hit an issues with animations and the Player Controller
Hello everyone!
I started off with the open source Quake 2 controller. Everything was good! I wanted to add in some animations.
(Quake Source) https://dotnetfiddle.net/KF6X6G
So at this point I brought in some animations into Unity. Following along to a tutorial the instructor created a 'PlayerControls.' I thought (I have a Player Controller script maybe this is just a separate script for animations?) I followed along to the tutorial and my character did in fact jump! But I noticed that he first did the default jump and *then did the animated jump.
I'm guessing the PlayerControls that the instructor is using is the PlayerController that I have just a different name? So when I jump both scripts are causing the jump?
This was the separate script I had started for animations...
https://dotnetfiddle.net/pb9djB
Being new to coding I was hoping that it would be a different script because when I look through the source code I am at a loss! If I do have to input the animation controller in there where do I do it?!
So then I tried to input that new script's elements into the original source code. I started by adding
static Animator anim;
Everything was okay. But then when it came to adding anim = GetComponent();
I couldn't find a void start. Just a private void start.
It's like a foreign language to me at the moment. If I am to put the code for animations into my PlayerController how do I know where to put it? Any tips for beginning to understand this? To be honest I feel overwhelmed. I'm trying to stay positive but every time I think I have a bit of a grasp I realize I know nothing. Which is fine.... We all gotta start somewhere. But - I worry that I'll never understand this stuff. It's one thing not being able to remember the code it's another not even knowing where to place it.
One other question I had... My camera placement is going to be in the PlayerController script? If so - Is this what determines the camera height? public float playerViewYOffset = 0.6f;
Thank you, friends! I switched to Unity (over an unnamed engine!!) Because of how helpful the community is. I really do appreciate your help and insight.
Your answer
Follow this Question
Related Questions
Animator Position VS Script Vector 3 0 Answers
Making your ai attack then return to the navmesh when player leaves trigger 0 Answers
Animation/Movement Error 1 Answer
What reason could there be, if a parent object refuses to take the new given position? 0 Answers
Flipping Animation/Jumping animation 0 Answers