- My Forums
- Tiger Rant
- LSU Recruiting
- SEC Rant
- Saints Talk
- Pelicans Talk
- More Sports Board
- Fantasy Sports
- Golf Board
- Soccer Board
- O-T Lounge
- Tech Board
- Home/Garden Board
- Outdoor Board
- Health/Fitness Board
- Movie/TV Board
- Book Board
- Music Board
- Political Talk
- Money Talk
- Fark Board
- Gaming Board
- Travel Board
- Food/Drink Board
- Ticket Exchange
- TD Help Board
Customize My Forums- View All Forums
- Show Left Links
- Topic Sort Options
- Trending Topics
- Recent Topics
- Active Topics
Started By
Message
Code for a game I'm developing-- in need of help// problem 1/99999999
Posted on 5/15/14 at 1:23 pm
Posted on 5/15/14 at 1:23 pm
Ok. It's for a simple Melee hit. I'm trying to see if the melee works by allowing a message to pop up in the console. If it does.. then it works. but instead I'm facing this problem. here's the code.
#pragma strict
var TheDamage : int = 50;
var Distance : float;
function Update ()
{
if(Input.GetButtonDown("Fire1"))
{
var hit : RaycastHit;
if(Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), hit));
{
Distance = hit.distance;
hit.transform.SendMessage("ApplyDamage", TheDamage, SendMessageOptions.DontRequireReciever);
}
}
}
The problem is
Distance = hit.distance;
The engine is stating that it was expecting : instead of =
If I change = to : to see the outcome, a whole mess of shite happens.
So, can anyone tell me with the problem?
TIA
#pragma strict
var TheDamage : int = 50;
var Distance : float;
function Update ()
{
if(Input.GetButtonDown("Fire1"))
{
var hit : RaycastHit;
if(Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), hit));
{
Distance = hit.distance;
hit.transform.SendMessage("ApplyDamage", TheDamage, SendMessageOptions.DontRequireReciever);
}
}
}
The problem is
Distance = hit.distance;
The engine is stating that it was expecting : instead of =
If I change = to : to see the outcome, a whole mess of shite happens.
So, can anyone tell me with the problem?
TIA
This post was edited on 5/15/14 at 1:25 pm
Posted on 5/15/14 at 1:24 pm to TigerDik86
I took visual basic in college. I can create a text box for you
Posted on 5/15/14 at 1:24 pm to TigerDik86
Ehhh you might have better luck on a game developer board or something.
Having said that, I'm gonna go with tree fiddy
Having said that, I'm gonna go with tree fiddy
Posted on 5/15/14 at 1:33 pm to jefforize
quote:
God: "I hated java."
Posted on 5/15/14 at 1:40 pm to jefforize
quote:
Print "hello world!";
you beat me to it
Posted on 5/15/14 at 1:46 pm to TigerDik86
I am taking a huge uneducated stab here, but you set Distance as a float, but is hit.distance also a float?
Posted on 5/15/14 at 1:51 pm to TigerDik86
quote:
if(Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), hit));
Not sure if you copy-pasted the code in or typed it in, but you have a ; at the end of this if statement which is right before the Distance = hit.distance; line.
Posted on 5/15/14 at 3:21 pm to Eternalmajin
quote:
Eternalmajin
I fricking love you
Posted on 5/15/14 at 3:36 pm to TigerDik86
wait... no i don't. Still having a problem.
Posted on 5/15/14 at 3:37 pm to TigerDik86
When you get shite like that which makes no sense, always look on the lines before (or the lines that call that spot).
eta: Same issue? Or another?
eta: Same issue? Or another?
This post was edited on 5/15/14 at 3:38 pm
Posted on 5/15/14 at 3:56 pm to Eternalmajin
actually,
after analyzing the script, your comment has led to the solution.
Thank you GB!
after analyzing the script, your comment has led to the solution.
Thank you GB!
Posted on 5/15/14 at 9:44 pm to belowmebama
quote:
I want a free copy.
You would
Popular
Back to top
Follow TigerDroppings for LSU Football News