warring cs0414
using UnityEngine; using System.Collections;
public class playercontroler : MonoBehaviour {
//movement varialbe
public float runspeed;
Rigidbody myrb;
Animator myAnim;
// Use this for initialization
void Start () {
myrb = GetComponent<Rigidbody> ();
myAnim = GetComponent<Animator> ();
}
// Update is called once per frame
void Update () {
}
void Fixedupdate(){
float move = Input.GetAxis ("Horizontal");
myAnim.SetFloat ("speed", Mathf.Abs (move));
}
}
Answer by Jessespike · Jul 18, 2016 at 07:35 PM
Not really a problem. It's just saying the variable runspeed is not being used.
To remove the warning, either use runspeed or delete it.
http://answers.unity3d.com/questions/542073/warning-cs0414.html
Sir I am not experience in c# progra$$anonymous$$g how solve a problem cs0414 When delete rigibody my game character not working
you should copy-paste the whole warning/error, (description and line #). so the problem is more clear.
If the rigidbody is removed than the script will throw an error when it tries to get it with GetComponent<RigidBody>();
"not working" is not very descriptive, what's not working? How should it work?
Delete the variables you are not using if you don't want to see that warning. Nobody said you should remove the rigid body from your character. What @Jessepike told you was to remove the runspeed
variable!
Your answer
Follow this Question
Related Questions
Change Script runtime with keeping reference 0 Answers
Entity Framework Core 0 Answers
How to enable System.Data in Mono on Mac? 0 Answers
Can't add script component "" because the scrrpit class nannot be found 0 Answers
Classes that inherit UIBehaviour in a DLL no longer visible in Unity editor. 2 Answers