- Home /
Simple error in void class
I'm having a simple coding problem with C#, i started learning it this week, but its really frustrating for me to use it, its been 4 days i'm trying to get the game to work, but i cant even start because of compilation errors :/
it may be really simple, but im still newbie at programming. thanks in advance and sorry if my writing is bad, i dont live in a english language country.
Answer by tw1st3d · Sep 01, 2013 at 03:45 PM
Line 6
public float speed = 10
you're missing a ;
public float speed = 10;
Dunno, maybe it's the public in your class creation. This code isn't throwing me any errors, however.
using UnityEngine;
using System.Collections;
class BulletBehavior : $$anonymous$$onoBehavior
{
public float speed = 10.0f; //Your speed
public Transform thisObj; //Define in editor
//Use this for initialization
void Start()
{
}
//Update is called once per frame
void Update()
{
thisObj.Translate(Vector3.forward * speed);
}
}
He probably didn't save the script before running it.
Your answer
Follow this Question
Related Questions
2 hand weapons, using dynamic hands with the razer hydra controllers 0 Answers
In-game scripting implementation 0 Answers
TextMeshPro Array 1 Answer
Network information 1 Answer
First Person Controller Physics 2 Answers