Hey guys Im following a tutorial on youtube from the TornadoTwins. This is the script I was told to use for my Move Around prefab.
var speed = 3.0;
var rotateSpeed = 3.0;
var bullitPrefab : Transform;
function Update ()
{
var controller : CharacterController = GetComponent(CharacterController);
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
var forward = transform.TransformDirection(Vector3.forward);
var curSpeed = speed * Input.GetAxis ("Vertical");
controller.SimpleMove(forward * curSpeed);
if(Input.GetButtonDown("Jump"))
{
var bullit = Instantiate(bullitPrefab,
GameObject.Find("spawnPoint").transform.position,
Quaternion.identity);
}
@script RequireComponent(CharacterController);
I keep getting this error:
Assets/Move Around.js(23,5): BCE0044: expecting }, found '@script'.
Any idea on the fix?
thanks it worked...im really enjoying how fast my questions get answered.
– anon64834601Well, welcome to the world of Unity Answers. Most questions get really quick replies here. :)
– Statement