Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink
Share
Go down
Member [Lv. 3]
Member [Lv. 3]
Posts : 20
Points : 1567
Rep : 0
Join date : 2014-05-13
Age : 17
Location : Queensland, Australia
View user profile

help with AI script

on Tue Jul 01, 2014 9:00 pm
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
http://www.servimg.com/image_preview.php?i=2&u=18917785][img]http://i39.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)
avatar
SUPER MODERATOR
SUPER MODERATOR
Posts : 279
Points : 2142
Rep : 58
Join date : 2013-12-16
Age : 17
Location : Boise Idaho United States
View user profile

Re: help with AI script

on Tue Jul 08, 2014 2:14 pm
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
Member [Lv. 3]
Member [Lv. 3]
Posts : 20
Points : 1567
Rep : 0
Join date : 2014-05-13
Age : 17
Location : Queensland, Australia
View user profile

Re: help with AI script

on Wed Jul 09, 2014 6:56 am
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.
Back to top
Permissions in this forum:
You cannot reply to topics in this forum