Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Deek on April 21, 2017, 01:44:37 PM
-
Hey folks,
the problem I'm facing today is that when I try to execute the said Action at runtime i get the following Error:
NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMaker.Actions.MousePick2dEvent.DoRaycast () (at Assets/PlayMaker/Actions/Physics2D/MousePick2dEvent.cs:103)
HutongGames.PlayMaker.Actions.MousePick2dEvent.DoMousePickEvent () (at Assets/PlayMaker/Actions/Physics2D/MousePick2dEvent.cs:68)
HutongGames.PlayMaker.Actions.MousePick2dEvent.OnUpdate () (at Assets/PlayMaker/Actions/Physics2D/MousePick2dEvent.cs:61)
HutongGames.PlayMaker.FsmState.OnUpdate () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:256)
HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2618)
HutongGames.PlayMaker.Fsm.Update () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1865)
PlayMakerFSM.Update () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:509)
This might be because I upgraded from a previous Playmaker Version that had the 'PlaymakerUnity2D.unitypackage' Extension installed, but I deleted that folder since 2D Actions are now part of the official Playmaker Versions.
I now have Playmaker Version 1.8.4 and the GameObject this FSM is attached to has a Sprite Renderer and a Box Collider 2D.
When I click on the Error it references to the highlighted line in the second Attachment.
Since I have no clue what could cause this or how to fix this, I hope someone here can.
-
Hi,
Are you using this on unity UI objects? if so, that will not work.
You can get the action for UI on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)
Search for 'ugui proxy full' and install the package.
for some tutorials you can check the User Tutorial Wiki Page (https://hutonggames.fogbugz.com/default.asp?W548)
-
Hi,
Are you using this on unity UI objects? if so, that will not work.
You can get the action for UI on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)
Search for 'ugui proxy full' and install the package.
for some tutorials you can check the User Tutorial Wiki Page (https://hutonggames.fogbugz.com/default.asp?W548)
I figured out what caused it. I had no camera in the scene that was tagged as 'MainCamera'; thats what the .DoRaycast() function seems to search for. Now everything works flawlessly.
Still thanks for taking your time to look into this.