Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: sebaslive on August 03, 2015, 08:08:24 PM

Title: Add Force Explosion 2D
Post by: sebaslive on August 03, 2015, 08:08:24 PM
There currently isn't an explosion force for 2D right now so I have gone ahead and made an action for it.

The inputs have info on each of them to explain what they do.

Enjoy exploding 2d things!

Title: Re: Add Force Explosion 2D
Post by: Ahkronn on August 29, 2015, 12:19:59 PM
Awesome. Thanks for this.

<Edit>
I had some issues with it but I just realized that Explosion and Add Explosion Force are two different things :P
I was looking for the latest. Still, thanks for this one.
Title: Re: Add Force Explosion 2D
Post by: jeanfabre on September 02, 2015, 01:40:52 AM
Hi,

 Very good!!

 one thing: don't add a delegate every update, you only should do this once on Enter, and remove the delegate once, on exit or when explosion is triggered.

 Bye,

 Jean
Title: Re: Add Force Explosion 2D
Post by: sebaslive on September 02, 2015, 12:18:48 PM
Oh, thanks Jean! I am still getting used to these actions and there customs. I appreciate the help!
Title: Re: Add Force Explosion 2D
Post by: jeanfabre on September 03, 2015, 01:16:22 AM
Hi

 That's fine, you are doing very well indeed, and we really appreciate your effort and contributions!

Bye,

 Jean
Title: Re: Add Force Explosion 2D
Post by: szomaza on October 10, 2017, 05:29:27 AM
Thanks a bunch for sharing actions!

I was looking for this one, but unfortunately it does not work with the latest version of Playmaker and Unity.

It says:
Code: [Select]
Assets/PlayMaker/3rd Party Actions/Explosion2D.cs(30,13): error CS0246: The type or namespace name `PlayMakerUnity2d' could not be found. Are you missing an assembly reference?

Assets/PlayMaker/3rd Party Actions/Explosion2D.cs(31,13): error CS0246: The type or namespace name `PlayMakerUnity2DProxy' could not be found. Are you missing an assembly reference?

Assets/PlayMaker/3rd Party Actions/Explosion2D.cs(115,17): warning CS0114: `HutongGames.PlayMaker.Actions.Explosion2D.DoTriggerEnter2D(UnityEngine.Collider2D)' hides inherited member `HutongGames.PlayMaker.FsmStateAction.DoTriggerEnter2D(UnityEngine.Collider2D)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword

Title: Re: Add Force Explosion 2D
Post by: jeanfabre on October 11, 2017, 02:45:45 AM
Hi,

 I have put this action on the Ecosystem, can you get it and let me know if it works ok on your end?

https://github.com/jeanfabre/PlayMakerCustomActions_U4/blob/master/Assets/PlayMaker%20Custom%20Actions/Physics2D/Explosion2D.cs

 bye,

 Jean
Title: Re: Add Force Explosion 2D
Post by: szomaza on October 27, 2017, 02:19:14 AM
Hi Jean,

Thank you very much!

I tried it and found 2 problems:
- the timer reaches 0, there is no explosion and the timer keeps running counting down to smaller negative numbers and FINISH event is never called,
- it gives a few of the following error when the timer reaches 0

Code: [Select]
NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMaker.Actions.Explosion2D.DoExplosion () (at Assets/PlayMaker Custom Actions/Physics2D/Explosion2D.cs:104)
HutongGames.PlayMaker.Actions.Explosion2D.OnFixedUpdate () (at Assets/PlayMaker Custom Actions/Physics2D/Explosion2D.cs:97)
HutongGames.PlayMaker.FsmState.OnFixedUpdate () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:240)
HutongGames.PlayMaker.Fsm.FixedUpdateState (HutongGames.PlayMaker.FsmState state) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2678)
HutongGames.PlayMaker.Fsm.FixedUpdate () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2005)
PlayMakerFixedUpdate.FixedUpdate () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFixedUpdate.cs:18)


Br,
szomaza
Title: Re: Add Force Explosion 2D
Post by: jeanfabre on October 27, 2017, 02:37:33 AM
Hi,

 ok, fixed, please update the action.

 Bye,

 Jean
Title: Re: Add Force Explosion 2D
Post by: szomaza on November 03, 2017, 05:30:08 AM
I just checked quickly and there is no more error, but I can't seem to get it to push anything.
Tried a few different settings and I am not sure if I am doing something wrong or it just does not work.
I can see the radius expanding during play but 2D phys objects around are not pushed.

All those values that need to/can be set are a bit confusing.

I'll stop with this now.
Please post a screenshot if/when somebody gets it working.

Edit:
I needed this again and managed to figure out what I was doing wrong: The object needs to have a Circle Collider 2D, as the action grows that to push stuff.
Please improve the action when you have some time to warn if the Circle Collider 2D is missing.
Title: Re: Add Force Explosion 2D
Post by: jeanfabre on November 07, 2017, 01:19:03 AM
Hi,

 I tested and it worked fine, I would keep trying, if you still can't get it to work, I'll set up a quick scene for proof of concept.

 Bye,

 Jean