2

How to fix cs1061 'movement' doesn't contain definition for 'movement' and no a...

 2 years ago
source link: https://www.codeproject.com/Questions/5320663/How-to-fix-cs1061-movement-doesnt-contain-definiti
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How to fix cs1061 'movement' doesn't contain definition for 'movement' and no accessible extension 'movement' accepting a first argument of type movement be found?

See more:

I had made a C# script in unity about dashing my character here is the script .
public class Dash : MonoBehaviour
{
Movement Move;
public float DashSpeed;
private float DashTime;

// Start is called before the first frame update
void Start()
{
Move=GetComponent<movement>();
}

// Update is called once per frame
void Update()
{
if(Input.GetKey(KeyCode.LeftShift)||Input.GetKey(KeyCode.RightShift))
{
StartCoroutine(Dashing());

}
}
IEnumerator Dashing()
{
float startTime= Time.time;

while(Time.time < startTime + DashTime)
{
Move.Movement.Move(Move.runSpeed * DashSpeed *Time.deltaTime);

yield return null;
}

What I have tried:

Actually I did take a bit help from tutorials but not copy pasting entire code.Previosly my script had class name and method name same I changed that and I had another bug due to writting Move.controller.move();. since I didn't had character controller like tutorial nor I can add Character controller script I had due to console error so I changed to Move.controller.move(); to Move.Movement.move(); and I came up this error as mentioned above look at script where the error is
IEnumerator Dashing()
{
float startTime= Time.time;

while(Time.time < startTime + DashTime)
{
Move.Movement.Move(Move.runSpeed * DashSpeed *Time.deltaTime);

yield return null;
}


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK