- Home /
Question by
luke493621 · Apr 21, 2014 at 07:36 PM ·
error-handling
melee script help
i am new to unity and trying to do melee script and got 5 errors please help here is my script
#pragma strict
var dammage : int = 75;
var distance : float;
function Update ()
{
if (Input.GetButtonDown("Fire1"))
{
var hit : RaycastHit;
if (Physics.Raycast (transform.position, transform.forward, hit))
{
distance = hit.distance;
hit.transform.sendMessage("ApplyDammage"), dammage, SendMessageOptions.DontRequireReceiver);
{
{
{
Comment
Answer by perchik · Apr 21, 2014 at 07:37 PM
When you end a function call that started with an open bracket { you need to close it with the closed bracket }. In your code you use open brackets again.
Replace the character on each of the last three lines with }
(Not guaranteed to fix everything, but will at least fix the majority of your problems)
Your answer