|
I want to make it so when the player walks over this trigger it stops movement but still lets them move the camera
Thats what i've got but it comes up with the error "Object reference not set to an instance of an object" Any help would be much appreciated
(comments are locked)
|
|
has to be: without the "" Both are fine.
Apr 28 '12 at 05:49 PM
fafase
Type is better than string though lol
Apr 28 '12 at 05:50 PM
Lo0NuhtiK
Indeed.I just punched my screen reading the "has to be:" and my girlfriend behind told me "Don't let him get away with it!!". But yes, without "" is better. So for serious information, both are working but without the "" is more efficient.
Apr 28 '12 at 05:54 PM
fafase
(comments are locked)
|
...or just using [ other.GetComponent(CharacterMotor).enabled = false ;] would probably work also... what I think you're missing though, is simply the 'other.' part since I'm assuming your script is on another object and you need to get the character motor script off of the object that enters it (what your code does at the moment, is try to get CharacterMotor from the object which this script is attached to, not the object that enters it)
(comments are locked)
|
