Quantcast
Channel: Questions in topic: "melee"
Viewing all articles
Browse latest Browse all 201

Melee system script help

$
0
0
#pragma strict var Damage : int = 25; 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", Damage, SendMessageOptions.DontRequireReceiver); } } ; This is a script for a melee system but i keep getting an error message saying "Assets/Themeleesystem.js(11,70): BCE0023: No appropriate version of 'UnityEngine.Transform.TransformDirection' for the argument list '(UnityEngine.Vector3, UnityEngine.RaycastHit)' was found." How can this be fixed. Any help will be appreciated if it matters its unity 3D

Viewing all articles
Browse latest Browse all 201

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>