Question by
fun4foes · Nov 12, 2016 at 02:41 AM ·
gamefirstunexpected-symbol
Says that { is unexpexted put it doesn't work even if i take it out. PLEASE HELP!!!
using System.Collections.Generic; using UnityEngine;
public class PlayerController : MonoBehaviour {
public float speed;
private Rigidbody rb;
void Start ()
{
rb = GetComponent<Rigidbody> ();
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement * speed);
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Pick Up")
{
other.gameObject.SetActive (false);
}
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612100520im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
There is no lighting and animation in game preview 0 Answers
Help with checking if gameobjects are the same on diagonal 1 Answer
My score system doesn't display or work? Please help me! 1 Answer
applying and saving in UpgradeSystem 1 Answer
How to make a cleaning effect similar to the one in dumb ways to die? 0 Answers