playMaker

Author Topic: Add Force Explosion 2D  (Read 1548 times)

sebaslive

  • Hero Member
  • *****
  • Posts: 539
    • View Profile
    • Frame Tale Studios
Add Force Explosion 2D
« on: August 03, 2015, 05: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!

All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

Ahkronn

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Re: Add Force Explosion 2D
« Reply #1 on: August 29, 2015, 09:19:59 AM »
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.
« Last Edit: August 30, 2015, 08:55:11 AM by Ahkronn »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Add Force Explosion 2D
« Reply #2 on: September 01, 2015, 10:40:52 PM »
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

sebaslive

  • Hero Member
  • *****
  • Posts: 539
    • View Profile
    • Frame Tale Studios
Re: Add Force Explosion 2D
« Reply #3 on: September 02, 2015, 09:18:48 AM »
Oh, thanks Jean! I am still getting used to these actions and there customs. I appreciate the help!
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Add Force Explosion 2D
« Reply #4 on: September 02, 2015, 10:16:22 PM »
Hi

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

Bye,

 Jean

szomaza

  • Full Member
  • ***
  • Posts: 172
    • View Profile
Re: Add Force Explosion 2D
« Reply #5 on: October 10, 2017, 02: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


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Add Force Explosion 2D
« Reply #6 on: October 10, 2017, 11:45:45 PM »
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

szomaza

  • Full Member
  • ***
  • Posts: 172
    • View Profile
Re: Add Force Explosion 2D
« Reply #7 on: October 26, 2017, 11:19:14 PM »
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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Add Force Explosion 2D
« Reply #8 on: October 26, 2017, 11:37:33 PM »
Hi,

 ok, fixed, please update the action.

 Bye,

 Jean

szomaza

  • Full Member
  • ***
  • Posts: 172
    • View Profile
Re: Add Force Explosion 2D
« Reply #9 on: November 03, 2017, 02: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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Add Force Explosion 2D
« Reply #10 on: November 06, 2017, 11:19:03 PM »
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