- Home /
How to turn a spawned enemy ( AI ) target on player?/ Why are my Hierarchy object turn prefab then no longer hold the transform object?
Hi all unities,
Why are my Hierarchy object turned to prefab then no longer hold the transform object I set in hierarchy window before, how to turn a spawned enemy ( AI ) targeting on player?
Please show me javascript snippet thanks.
thanks.
Comment
I guessed I fixed this particular problem just wondered why the Transform modifier cannot hold the same value as before it become a prefab... But I am done with this at this mean time...
Answer by Aydan · Apr 25, 2011 at 09:09 AM
I think this should work
var target : GameObject;
function Start(){ target = GameObject.Find("Player"); }