playMaker

Author Topic: HOTween playmaker custom actions  (Read 35217 times)

Mayhem

  • Full Member
  • ***
  • Posts: 171
    • View Profile
Re: HOTween playmaker custom actions
« Reply #45 on: October 31, 2013, 12:10:03 PM »
How would this global Rewind-Action work?

Would it work like this Action, so I can give an ID and it would rewind all Tweens with the same ID?

When do I have to use the Action in PlayMaker? Immediately after I use this new "Hotween Play"-Action?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14611
  • Official Playmaker Support
    • View Profile
Re: HOTween playmaker custom actions
« Reply #46 on: October 31, 2013, 09:24:34 PM »
Hi,

 yes, it would be the same context, tho you would call "Rewind" just before calling "Play" if you want to rewind before playing.

Would that do?

Bye,

 Jean

Mayhem

  • Full Member
  • ***
  • Posts: 171
    • View Profile
Re: HOTween playmaker custom actions
« Reply #47 on: November 01, 2013, 02:14:01 AM »
I think that should do. You're the best :D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14611
  • Official Playmaker Support
    • View Profile
Re: HOTween playmaker custom actions
« Reply #48 on: November 01, 2013, 04:36:34 AM »
Hi,

 ok, have a go with this, I also added a Restart and Pause, to complete the available function. I think you actually want Restart after all anyway.

Bye,

 Jean

Mayhem

  • Full Member
  • ***
  • Posts: 171
    • View Profile
Re: HOTween playmaker custom actions
« Reply #49 on: November 17, 2013, 01:27:22 PM »
Is there an action to determine if a Tween with an ID is tweening at the moment?

Edit:

I tried it to do it myself, but that does not work:

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.

using UnityEngine;
using Holoville.HOTween;
using System.Collections.Generic;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("HOTween")]
[Tooltip("Pauses ALL tweens of a given ID")]
public class HotweenIsTweening: PlayMakerHOTweenAction
{

public FsmString tweenID;

[Tooltip("is the clip playing?")]
[UIHint(UIHint.Variable)]
public FsmBool isPlaying;

[Tooltip("Event to send if the Bool variable is True.")]
public FsmEvent isTrue;

[Tooltip("Event to send if the Bool variable is False.")]
public FsmEvent isFalse;

[Tooltip("Repeat every frame while the state is active.")]
public bool everyFrame;

public override void Reset()
{
isPlaying = null;
isTrue = null;
isFalse = null;
everyFrame = false;

tweenID = null;

}


public override void OnEnter()
{
DoIsPlaying();

if (!everyFrame)
{
Finish();
}
}

public override void OnUpdate()
{
DoIsPlaying();
}

void DoIsPlaying()
{

bool _isPlaying = HOTween.IsTweening(tweenID.Value);
isPlaying.Value = _isPlaying;

if (_isPlaying)
{
Fsm.Event(isTrue);
}else{
Fsm.Event(isFalse);
}


}
}
}

It's always false, even when the Tween is playing :/
« Last Edit: November 17, 2013, 01:41:42 PM by Mayhem »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14611
  • Official Playmaker Support
    • View Profile
Re: HOTween playmaker custom actions
« Reply #50 on: November 17, 2013, 11:46:45 PM »
Hi,

 Can you double check with the author himself? if you can validate that you are doing the right thing first, it's important, then you make it as an action.

 When I face such problems, I take it out of PlayMaker, test with simple behaviors, and when I have it working, I go back to my action within PlayMaker.

 Keep me updated on this and shout if you are getting nowhere.

 Bye,

 Jean

kuolema

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: HOTween playmaker custom actions
« Reply #51 on: March 17, 2014, 10:37:17 PM »
Nevermind! It's an incompatible asset that is causing the issue.
« Last Edit: March 18, 2014, 06:50:17 PM by kuolema »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14611
  • Official Playmaker Support
    • View Profile
Re: HOTween playmaker custom actions
« Reply #52 on: March 26, 2014, 04:37:17 AM »
Hi,

 I double checked with the latest hotween from the asset store and I don't have any issues, can you make sure you are using the latest as well?

bye,

 Jean

FritsLyn

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: HOTween playmaker custom actions
« Reply #53 on: June 18, 2014, 07:03:14 AM »
This package could really need some TLC - and to be added to the Ecosystem.

FritsLyn

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: HOTween playmaker custom actions
« Reply #54 on: July 02, 2014, 12:22:50 PM »
I'm going crazy over this, because of the lack of documentation.. How is "Hotween To" supposed to work?

I know about this:
http://hotween.demigiant.com/documentation.html
But I cannot seam to understand the logic in the PlayMaker Action?!

Example: If I just want to rotate something to 0,0,0 ?

I set:
Target (Game Object to rotate)
Prop Name: I write the string 'rotation'
Duration: I write '10' for 10 seconds

.. but nothing happens!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14611
  • Official Playmaker Support
    • View Profile
Re: HOTween playmaker custom actions
« Reply #55 on: July 10, 2014, 05:01:33 AM »
Hi,

 What do you mean by "TLC" ? I can't add packages using asset store packages just yet, as it would create errors if you'd download one without having the required package alread, so I need to come up with a system that would either double check with the user prior downloading that indeed the user has this asset, or best check it automatically and warn/point to the required assets. Indeed quite a difficult feature to implement properly.

The prop Name on "Hotween to" must be public or non static ( as in hotween doc and the tooltip of this action), and in your case, the rotation of a transform is unfortunatly not accessible this way. You should in this case create a hotween component and target the rotation using this component, then you can trigger that tween from PlayMaker.

Bye,

 Jean

FritsLyn

  • Full Member
  • ***
  • Posts: 191
    • View Profile
Re: HOTween playmaker custom actions
« Reply #56 on: July 11, 2014, 01:14:01 AM »
By 'TLC' I mean that since iTween is mostly not something one wants to use, then ATM this is the only real tween option one has with PlayMaker.

THis is in fact one of the most fundamental tools in the box atm. I understand that you guys are drowning in work and new inventions, but this is a basic and fundamental thing.

However there is not any wiki or the like on the use of this very fundamental tool.

This is what I mean by 'TLC'.

Since I cannot use the action as described and there's no documentation on how to use it - it would be great if you gave just 1 example of how it is supposed to be working, just some form of documentation.

I can read the Hotween documentation, but it does not explain how to use this Playmaker action :)

With all respect, you are doing a fantastic job!!

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: HOTween playmaker custom actions
« Reply #57 on: July 11, 2014, 06:19:22 AM »
Also actions to Kill the HOTween tweens are needed. (due to how they actually create gameobjects in the scene)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14611
  • Official Playmaker Support
    • View Profile
Re: HOTween playmaker custom actions
« Reply #58 on: July 16, 2014, 06:12:22 AM »
Hi,

 @FritsLyn : Have you had a chance to play with Hotween component to declare the tween properly using hotween only and then trigger it using the action "Hotween play by id"? there is an example on this in the package. This is how you need to do it for transforms.

@jess84: I'll work on this.

 Bye,

 Jean

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: HOTween playmaker custom actions
« Reply #59 on: August 01, 2014, 12:46:18 PM »
Hi Jean,

Is this on your radar for anytime soon?

It's the killing all tweens action that I'm really looking out for.