- Home /
Semicolon problem melee.
I've watched a video talking about how to make the main player attack with a melee weapon, I copied the strings but at 3, 22 the console says that i must insert a semicolon and if i insert it, the console says that expressions in statements must only be executed for their side-effects. How can i fix this? Here's my string (sorry if it's copied and pasted but i dunno how to insert it).
pragma strict
var TheDammage : 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("ApplyDammage", TheDammage, SendMessageOptions.DontRequireReceiver); } } }
please format your code - highlight the code and click on the 101/010 code tag button. as presented, it's almost unreadable.
Answer by gjf · Aug 02, 2014 at 02:30 PM
look like you hit - instead of =
var TheDammage : int = 50;
assuming it's 50 and not -50 ;)
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Health Help D: 2 Answers
Having Problem with mouseposition. 2 Answers
How can I put my game on the internet? 1 Answer
MultiTouch GUITexture Android 0 Answers