#```using System.Collections;
1 messages · Page 1 of 1 (latest)
I don't see a funciton in here named HandleAllMovement - it's possible you keep renaming your methods out from under yourself
yeah i dont understand the errors at all is it oke if i send all the scripts that keeps involving with the error
Mmm, probably better if we help you understand the errors
We want to teach you how to fish, ya know?
haha oke
What errors are confusing you right now?
Assets\Scripts\PlayerManager.cs(23,22): error CS1061: 'InputManager' does not contain a definition for 'HandleAllInputs' and no accessible extension method 'HandleAllInputs' accepting a first argument of type 'InputManager' could be found (are you missing a using directive or an assembly reference?)
Assets\Scripts\PlayerManager.cs(28,26): error CS1061: 'PlayerLocomotion' does not contain a definition for 'HandleAllMovement' and no accessible extension method 'HandleAllMovement' accepting a first argument of type 'PlayerLocomotion' could be found (are you missing a using directive or an assembly reference?)
using System.Collections.Generic;
using UnityEngine;
public class PlayerManager : MonoBehaviour
{
InputManager inputManager;
CameraManager cameraManager;
PlayerLocomotion playerLocomotion;
private void Awake()
{
inputManager = GetComponent<InputManager>();
cameraManager = FindObjectOfType<CameraManager>();
playerLocomotion = GetComponent<PlayerLocomotion>();
}
public void HandleAllInputs()
{
inputManager.HandleAllInputs();
}
private void FixedUpdate()
{
playerLocomotion.HandleAllMovement();
}
private void LateUpdate()
{
cameraManager.HandleAllCameraMovement();
}
}
but when i try to fix it i get other errors and if i fix those i get these one back
Do you understand what the error means when it says, for example, 'InputManager' does not contain a definition for 'HandleAllInputs'?
not realy i just started 4 days ago
haha okay, well welcome, and understanding that is pretty important
the wording might feel awkward or whatever, but it's often very particular, and you'll catch onto it with experience
When the parser sees a method name like HandleAllInputs, it looks at the object you're using and tries to find a method name called HandleAllInputs, but right now, it looks like there is no such method with that name
oke so how do i fix it
In that class, as you've posted, there is a HandleInputs, but that name is different from HandleAllInputs, so just make sure those names match (assuming that those are supposed to be the same thing)
Auto complete should have prevented this unless they've explicitly typed the unavailable method. Maybe the IDE isn't configured.
so i have to change all the HandleAllInputs in HandleInputs
yeah i dont know what IDE im using
I think there's something to be said for the exercise of programming without those guardrails 🙂
But the training wheels can also be nice
@tropic kelp Basically, you told it to use something called HandleInputs, but you never said what HandleInputs is
and it seems like you meant to tell it to use the thing you called HandleAllInputs
eehh how can i give it an definition
i gave it an definition in my inputmanager script but now i am stuck with this one
Assets\Scripts\PlayerManager.cs(28,26): error CS1061: 'PlayerLocomotion' does not contain a definition for 'HandleAllMovement' and no accessible extension method 'HandleAllMovement' accepting a first argument of type 'PlayerLocomotion' could be found (are you missing a using directive or an assembly reference?)
So, read the message over again - you said that you put it inside InputManager, but the parser isn't saying that it's looking in InputManager for it, it's looking inside something else - where is it looking? (The error message says where, and I want you to identify it)
Well, just to be clear - you're trying to tell the parser to call HandleAllMovements, and you put it in InputManager, but you're telling to look in PlayerManager - does that make sense?
no
which part of that is unclear?
everything
I don't really know to help you if you can't be more specific about what's confusing
To fix them, you really need to understand what they're even telling you
i was using a tutorial video from https://www.youtube.com/playlist?list=PLD_vBJjpCwJsqpD8QRPNPMfVUpPFLVGg4 i am now on the end of epsode 4
It's gonna fuck you over in the longrun if you just try to guess until it works
yeah but i worked on this for hours and i dont want to lose my progress
I understand
i had to write all of his scripts over and that took me hours and now i got it and i get errors
you're not gonna lose your progress
you're just not gonna learn anything if you guess your way through everything
and if you're not learning anything, you're just gonna waste your own time
i learned how to animate in unity so i did learn something
yeah, I understand
Just look back over this error and try to understand what it's trying to say:
'PlayerLocomotion' does not contain a definition for 'HandleAllMovement`
like, this is literally exactly the "error" that you need to fix, and it'll be very easy to fix when you understand what it's trying to say
yeah but do you think you can fix it for me cause i dont understand anyting right know
I can but I don't want to
All I want to do is help you understand the message, so if you have any questions about the error message, let me know
cant you just explain it to me
I did, #1304892119231631381 message
can you do it in babysteps
Okay, what does this error mean:
'PlayerLocomotion' does not contain a definition for 'HandleAllMovement?
i have to make a definition for playerlocomotion in the playermanager script
Yeah, that's one thing that you could do - do you know how to do that?
no
Okay, so when we talk about a "definition" for something, it means that you tell a class what it means to, for example, "HandleMovement". So, for example, you have this below:
public class PlayerLocomotion : MonoBehaviour
{
// ...
public void HandleMovement(Vector2 input)
{
Vector3 moveDirection = (cameraTransform.forward * input.y + cameraTransform.right * input.x).normalized;
moveDirection.y = 0; // Keep the movement on the XZ plane
rb.linearVelocity = moveDirection * movementSpeed;
}
// ...
}
So in the above code, if I were to word it out, I would say that the code is "creating a definition" for HandleMovement inside of PlayerLocomotion.
So when you say public void Func() {...}, you're telling the computer "this is a function called Func, and whenever you 'call' it, here's what I want you to do"
Are you following?
i follow
So if all of that makes sense, then you can proceed with [what you have here](#1304892119231631381 message)