playMaker

Author Topic: HOTween - Kill actions needed  (Read 3963 times)

jess84

  • Hero Member
  • *****
  • Posts: 515
HOTween - Kill actions needed
« on: June 22, 2014, 12:05:25 PM »
HOTween.

When a tween is running, it creates a gameobject. I'm having trouble with these persisting when I quit my game via a pause menu - they're in the next scene. As a result, when I load my level again, none of the tweens I've got set are triggered and I cannot progress.

Unfortunately I can't really find and destroy the object easily, as it doesn't give the object a layer or tag.

In the inspector, there are buttons available to Play / Pause / Kill (see screenshot).

It would be incredibly handy to have a playmaker action to Kill all HOTween objects in a scene.  Can someone do this?

Cheers,

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: HOTween - Kill actions needed
« Reply #1 on: June 23, 2014, 10:16:41 AM »
OK, so I've tried other ways of killing this object - but then I've realised it's not a gameobject, it's a Script.... so I can't use any playmaker actions to find it, let alone destroy it.

I'm assuming that given when the script is running, and there's a Kill option in the inspector - it should be an easy PlayMaker action to trigger this Kill?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: HOTween - Kill actions needed
« Reply #2 on: June 23, 2014, 08:10:30 PM »
Kill is a static method in Holoville.HOTween:
http://hotween.demigiant.com/hotweenAPI/class_holoville_1_1_h_o_tween_1_1_h_o_tween.html#a14d25c1ee1e166519207224490c3a369

You could try using the Call Static Method action in beta here:
http://hutonggames.com/playmakerforum/index.php?topic=7340.0

This should let you call the static Kill method.

But a custom action would be nicer. Maybe Jean can make it when he gets back from vacation ;)


jess84

  • Hero Member
  • *****
  • Posts: 515
Re: HOTween - Kill actions needed
« Reply #3 on: June 24, 2014, 08:19:12 AM »
Awesome, thanks for that info... time to step through it all incredibly slowly and hope it works :)

(And yes, custom actions would be awesome!)

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: HOTween - Kill actions needed
« Reply #4 on: June 24, 2014, 08:51:29 AM »
Hi again,

Sorry, so with this example:
Code: [Select]
static int Kill ( object  p_target ) [static]

Kills all the tweens for the given target (unless they're were created inside a Sequence), and returns the total number of killed Tweeners.

Parameters:
    p_target The target whose Tweeners to kill.

Returns:
    The total number of killed Tweeners.

What would I put in the Class Name and Method fields of the playmaker action?

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: HOTween - Kill actions needed
« Reply #5 on: July 02, 2014, 01:47:57 PM »
Bump for custom actions now Jean is back :)