Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: TheNecron on August 02, 2019, 12:02:41 AM

Title: Difficulty disabling Rigidbody 2D on projectile [SOLVED]
Post by: TheNecron on August 02, 2019, 12:02:41 AM
I'm using a projectile with a Rigidbody 2D that I want to disable with an fsm at a certain point and while I can disable the BoxCollider2D through the Enable Behavior action whenever I attempt to replicate that with Rigidbody 2D in place of BoxCollider2D it gives "Error Editting Action, Type cannot be null." I don't really understand why this occurs and if I'm missing something basic that would do this.
Title: Re: Difficulty disabling Rigidbody 2D on projectile
Post by: djaydino on August 03, 2019, 01:47:35 AM
Hi.
You can't disable a Rigidbody, but you can set the rigidbody type @ runtime with

"SetRigidBodyType2D" (Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181))

For collider you can set as trigger (Set Collider 2d Is Trigger)
or Activate/deactivate the component (search for 'activate component' on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181))
Title: Re: Difficulty disabling Rigidbody 2D on projectile
Post by: TheNecron on August 03, 2019, 10:34:46 AM
Hi.
You can't disable a Rigidbody, but you can set the rigidbody type @ runtime with

"SetRigidBodyType2D" (Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181))

For collider you can set as trigger (Set Collider 2d Is Trigger)
or Activate/deactivate the component (search for 'activate component' on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181))

Thanks, the SetRigidBodyType command on ecosystem was enough for what I was trying to do.