UnityNinja Community
Would you like to react to this message? Create an account in a few clicks or log in to continue.

UnityNinja CommunityLog in

UnityNinja - Video Game Development Community, including Resources, Forums, Marketplace & More.


descriptionhelp with AI script Emptyhelp with AI script

more_horiz
hi all,
i recently made this basic AI script but it simply doesn't work please help. (note any errors and BTW im using Monodevelope)
Thanks,
Kale
https://servimg.com/view/18917785/2][img]https://i.servimg.com/u/f39/18/91/77/85/script11.jpg

Note: i keep getting this error while playing
NullReferenceException
UnityEngine.Transform.get_position () (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/UnityEngineTransform.cs:27)
enemytest.Update () (at Assets/enemytest.cs:22)

descriptionhelp with AI script EmptyRe: help with AI script

more_horiz
Ok, have you added a tag to the player? If you haven't then you can add a tag in :edit -> tags (change the value of number of tags) then name one "Player", it is case sensitive in accordance to the script, make sure you go to the player gameobject, and change the tag in the inspector.
This should work Smile

descriptionhelp with AI script EmptyRe: help with AI script

more_horiz
Dont worry its all good. with
void Start ()
it was a lowercase s. funny something that small can mess it up. also can you help me with a gun recoil script or point me in the right direction with one thanks.

descriptionhelp with AI script EmptyRe: help with AI script

more_horiz
privacy_tip Permissions in this forum:
You cannot reply to topics in this forum
power_settings_newLogin to reply