- Home /
All errors have to be fixed
I created for my FPS game a script for bullits. var bullitPrefab:Transform;
function Update () {
if(Input.GetButtonDown("Jump"))
{
var bullit = Instantiate(bullitPrefab, GameObject.Find("spawnPoint").transform.position, Quaternion.identity);
bullitPrefab.rigidbody.AddForce(Transform.forward * 200);
}
}
But there is one problem if i run the game in unity it sets: All compiler errors have to be fixed before enter playmode. What does this mean? I tried this: All bullit rename to arrow because my bullit is named Arrow That doesnt work Then i did all rename back to bullit and rename the arrow to bullit. How do i fix this?
Answer by robertbu · Dec 19, 2013 at 04:24 PM
You open the "Console" window if it is not already open, and you double click on any error in red. That will highlight the error in Monodevelop. Then you fix the error.
Looking at this script, you need 'transform' (lower case 't') rather than 'Transform' on line 7:
bullitPrefab.rigidbody.AddForce(transform.forward * 200);
Thanks for helping. I should use it tomorrow because i'm talking with my $$anonymous$$m over the game.