Author Topic: Error when disabling player controller's rigidbody's gravity.[SOLVED]  (Read 597 times)


  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • My Video Game Projects Web Site
I want my player controller to climb walls, but if I do player controller simple move along that vertical axis, the player just ignores that due to its gravity I think. As shown in the screenshots, I get an error when I use set property to disable the character controller's attached rigidbody. This inability to edit the character controller script to turn off gravity means I can't get the character to jump, glide, slide down hills correctly, or climb, and it's driving me nuts. Why did Unity make the script un-editable? someone said there's a standard assets "3d person platformer controller" but I can't find that in the standard assets anywhere, either.

The screenshots show tests AFTER removing the attached rigidbody from the player game object, but the error was the same with or without it. and the character drops if I manually raise it up and release it, implying it already has a rigidbody attached that I can't see.

Also, to confirm, is it true I should NEVER also attach a rigidbody to a game object with a player controller, since the player controller apparently has a rigidbody embedded in it, as this would mean there are two rigidbodies on the same game object? But it seems I also need to add a rigidbody because I try to do things to the character controller like Add Force, playmaker tells me the game object needs a rigidbody?

Here's the error:

NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMaker.ReflectionUtils.SetMemberValue (System.Reflection.MemberInfo[] memberInfo, System.Object target, System.Object value) (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ReflectionUtils.cs:351)
HutongGames.PlayMaker.FsmProperty.SetValue () (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmProperty.cs:309)
HutongGames.PlayMaker.Actions.SetProperty.OnEnter () (at Assets/PlayMaker/Actions/SetProperty.cs:26)
HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex) (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState.OnEnter () (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2767)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState) (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2714)
HutongGames.PlayMaker.Fsm.UpdateStateChanges () (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2642)
HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state) (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2783)
HutongGames.PlayMaker.Fsm.Update () (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1994)
PlayMakerFSM.Update () (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:579)

Unity Version: 2018.3.0f2
Playmaker Version: 1.9.0.f5
BuildTarget: StandaloneWindows64

System Info:
OS: Windows 10  (10.0.0) 64bit
Processor: AMD FX(tm)-4130 Quad-Core Processor
System Memory: 32749
Graphics Device: NVIDIA GeForce GTX 970

as always, the bug reporter says unity 2017.1 broke it and to copy and paste everything, so this is what I needed to do.
« Last Edit: February 07, 2019, 11:21:46 PM by jeanfabre »


  • Administrator
  • Hero Member
  • *****
  • Posts: 4980
    • View Profile
    • jinxtergames
Re: Error when disabling player controller's rigidbody's gravity.
« Reply #1 on: February 07, 2019, 10:19:43 AM »
To enable/disable gravity, you can use the action "Use Gravity"

but the main issue is that the character controller is only good for some quick testing

As jump and stuff is a nightmare to get it to work with it.

Best is to build your own.

Use axis actions to get movement controls, then use Velocity for movement and for example you can use force for jumping.


  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • My Video Game Projects Web Site
Re: Error when disabling player controller's rigidbody's gravity.
« Reply #2 on: February 07, 2019, 02:41:34 PM »
Thanks. I might have solved it. For a year, I've been using Controller Simple Move, which I just saw, says it "automatically applies gravity", and I never saw that clearly written in the description, but now I saw it. Switching over to Controller Move, now allows me to manually set and alter the Y vector value of the Move vector, meaning I can now make the character jump, glide, double jump, etc. (theoretically.)

Everyone always says to make your own controller, but this might solve the problems.

It was this tutorial that finally made me try the Controller Move action.