|
Is it possible to use a RayCast (idk know what a raycast is) to select an enemy? Like if i have a variable lets say And i wanted it if you clicked a object that had the script NPC_AI.cs that this variable would equal that enemy? If it is possible how could i go upon doing this? EDIT: Sorry i forgot to include this i have a tag also set up if its an enemy
(comments are locked)
|
|
For a good intro video to raycasting, click here Also, the Unity documentation is your friend. You can get the transform of an object that was hit with your raycast.. http://unity3d.com/support/documentation/ScriptReference/RaycastHit-transform.html More information on raycasts can be found here http://unity3d.com/support/documentation/ScriptReference/Physics.Raycast.html
(comments are locked)
|

Retagged...
Don't forget, you need to put a comma in between each tag
alright sorry i forgot about that