- Home /
new to this and got error code help to solve please
ive just started today trying to make a game so im doing the ball game to try and get the hang of it.
Assets/scripts/playercontroller.cs(10,48): error CS0119: Expression denotes a type', where a
variable', value' or
method group' was expected
that is the error they have given me and my code is using UnityEngine; using System.Collections;
public class playercontroller : MonoBehaviour { public float speed;
void fixedupdate ()
{
float moveHorizontal = Input("getaccessHorizontal");
float moveVertical = Input.GetAxis ("moveVertical");
Vector3 movement = new Vector3(moveHorizontal,0.0f,moveVertical);
rigidbody.AddForce(movement * speed * Time.deltaTime);
}
}
i dont know how to fix this error. please help. thanks.
Answer by mattyman174 · May 24, 2014 at 01:46 PM
void fixedupdate()
{
float moveHorizontal = Input("getaccessHorizontal");
This is all wrong.
void FixedUpdate()
FixedUpdate is a Unity specific function call and is Case Sensitive.
float moveHorizontal = Input.GetAxis("moveHorizontal");
Input is not a function but a class that has functions for retrieving values from particular input.
I suggest you follow some tutorials on programming in the C# language before you tackle more difficult tasks as you are obviously missing alot of fundamental concepts.
Your answer
![](https://koobas.hobune.stream/wayback/20220613145801im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Removing dead bodies, big lag issue. 2 Answers
How to Fix Compilier Errors? 0 Answers
NullReferenceException: Object reference not set to an instance of an object. 2 Answers
Teleportation Problem 1 Answer