- Home /
Question by
CyberGoose · Jun 24, 2015 at 07:02 AM ·
graphicsoptimization
I need help with this coding sequence...
This is the code:
using UnityEngine; using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
public float paddleSpeed = 1F;
public Vector3 playerPos; new Vector3(0,0,0);
void Update ()
{
float yPos = gameObject.transform.position.y + (Input.GetAxis ("Vertical") * paddleSpeed);
playerPos = new Vector3 (-22,Mathf.Clamp(yPos, -11,11),0);
gameObject.transform.position = playerPos;
}
}
But I am getting this error saying:
Assets/Scripts/Paddle.cs(7,47): error CS1519: Unexpected symbol `0' in class, struct, or interface member declaration
Any help will be appreciated.
Comment
Best Answer
Answer by $$anonymous$$ · Jun 24, 2015 at 07:02 AM
Instead of:
public Vector3 playerPos; new Vector3(0,0,0);
try this:
public Vector3 playerPos = new Vector3(0,0,0);