playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - dasbin

Pages: [1] 2 3 ... 7
1
Any luck with this Jean?

2
In the Editor, the Platform Dependent Events action works correctly and will call the appropriate event for the platform being built for (in this case, UNITY_IPHONE) or UNITY_EDITOR.

However, once I actually make a build for IOS and run either on my phone or Simulator, the event just hangs and does not pass anything at all.

I should note I am building for IL2CPP, not Mono, and using Unity 5.1.2.

3
Playmaker Bug Reporting / Re: Audio Play doesn't Finish()
« on: July 19, 2015, 12:25:21 PM »
Hi Jean,

Yes, that's correct. Don't you think that's most consistent with all other actions in Playmaker? They Finish immediately unless some other event is specified to be called.
I've modified the action to do this, but it seems to me pretty likely that other users would find this perplexing as well.

Code: [Select]

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Audio)]
[Tooltip("Plays the Audio Clip set with Set Audio Clip or in the Audio Source inspector on a Game Object. Optionally plays a one shot Audio Clip.")]
public class AudioPlay : FsmStateAction
{
[RequiredField]
[CheckForComponent(typeof(AudioSource))]
[Tooltip("The GameObject with an AudioSource component.")]
public FsmOwnerDefault gameObject;

[HasFloatSlider(0,1)]
        [Tooltip("Set the volume.")]
public FsmFloat volume;

[ObjectType(typeof(AudioClip))]
[Tooltip("Optionally play a 'one shot' AudioClip. NOTE: Volume cannot be adjusted while playing a 'one shot' AudioClip.")]
public FsmObject oneShotClip;

[Tooltip("Event to send when the AudioClip finishes playing.")]
public FsmEvent finishedEvent;

private AudioSource audio;

public override void Reset()
{
gameObject = null;
volume = 1f;
oneShotClip = null;
    finishedEvent = null;
}

public override void OnEnter()
{
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if (go != null)
{
// cache the AudioSource component

    audio = go.GetComponent<AudioSource>();
if (audio != null)
{
var audioClip = oneShotClip.Value as AudioClip;

if (audioClip == null)
{
audio.Play();

if (!volume.IsNone)
{
audio.volume = volume.Value;
}

if (finishedEvent == null)
{
Finish ();
}


return;

}

if (!volume.IsNone)
{
audio.PlayOneShot(audioClip, volume.Value);
if (finishedEvent == null)
{
Finish ();
}
}
else
{
audio.PlayOneShot(audioClip);
if (finishedEvent == null)
{
Finish ();
}
}

return;
}
}

// Finish if failed to play sound

Finish();
}

public override void OnUpdate ()
{
if (audio == null)
{
Finish();
}
else
{
if (!audio.isPlaying)
{
Fsm.Event(finishedEvent);
Finish();
}
                else if (!volume.IsNone && volume.Value != audio.volume)
{
audio.volume = volume.Value;
}
}
}
}
}

4
Playmaker Bug Reporting / Audio Play doesn't Finish()
« on: July 06, 2015, 02:36:48 PM »
Found a bug in the Audio Play action.
My states were all getting hung up on the action unless I was using the Finished Event feature of the action (which only fires the event when the audio is done playing... usually not desirable behavior, sometimes I want something else to happen right after starting a sound). My usual work-around was to manually send a delayed event right before using the action.

Looking at the code of the action, it will never call Finish() unless it either fails to play anything, or alongside calling the Finished Event selected. Normally, it will return out of all functions instead before Finish() is called.
If you don't specify a Finished Event it will hang on the action forever, and if you do it will only finish when the audio is done playing. Definitely a bug and not predictable behaviour.

5
General Discussion / Re: Unity 2D and Physics 2D Support now available
« on: February 10, 2014, 12:01:48 AM »
It's nothing to do with animations - it's required if you want your 2D physics objects to receive Trigger and Collision events via Playmaker. That's it.

6
General Discussion / Re: Unity 2D and Physics 2D Support now available
« on: January 31, 2014, 02:24:29 PM »
Looking through Jean's code in those sections, these are my best guesses:

- Your first error might be caused by not having the level in your Build Settings.

- The second error might be caused by not having a 2D Collider component attached to the other object (maybe just a Rigidbody2D with no collider?)

Just guesses.
If you still have trouble send me your scene packaged up and I will take a look.

7
General Discussion / Re: Unity 2D and Physics 2D Support now available
« on: January 30, 2014, 05:57:56 PM »
The "PlayMaker Unity 2D" Prefab needs to exist exactly *once* in every scene.

The PlayMakerUnity2DProxy component needs to be added to every 2D gameobject that you want Playmaker to detect 2D collisions / triggers on.

Perhaps confusion might come from some of the wording as Jean has sometimes called the prefab component the Proxy (while in the package the Proxy is the component you must add to each gameobject).

8
Playmaker Help / Re: OnTriggerStay alternatives?
« on: January 28, 2014, 09:15:09 PM »
Correct me if I'm wrong, but I think you've gone about this the wrong way - my understanding is that waiting for an OnTrigger event isn't actively "checking every frame," as you say (as the script itself isn't doing anything at all), but rather waiting for the physics engine to call the method on the script instead. The method is being "pushed" by the engine when needed and otherwise it's not called.
So you're probably doing yourself a disservice by re-entering that state over and over so quickly - PlayMaker stores its own "last collision" data set, so it might have something to do with it re-initializing access to that every time you enter the state.

In any case, all I can say is I have a whole bunch of objects (dozens) in my game constantly waiting for an OnCollisionStay event and the performance impact from all of them is sub-millisecond.

9
General Discussion / Re: Perlin Noise Action
« on: January 16, 2014, 02:38:25 PM »
Why not just:

x = random (0..1)
x = x - 0.5
x = x * 2

10
Playmaker Help / Re: Different Behaviour between PC and Android?
« on: January 13, 2014, 07:10:12 PM »
It sounds like you are saying an event is being sent before it is actually called, which doesn't really make sense. Unless there is a bug in the event handler which isn't taking into account the actual rendering. It might be worth getting to the bottom of what is causing it, and filing a bug report if need be.
Are you using Unity's built in animation system here?

11
Playmaker Help / Re: Vector Reflect in a Unity 2D (4.3) game
« on: January 13, 2014, 03:53:48 PM »
I don't understand what you mean by turning a Vector2 into a rotation. What kind of rotation? A Vec2 is just a direction or a point in space.

12
Playmaker Help / Re: Vector Reflect in a Unity 2D (4.3) game
« on: January 13, 2014, 03:50:56 PM »
Here's a bunch of Vector2 and 2D actions I've made/modified (again not all are fully tested) - hopefully you find what you need in here.

EDIT: Just realized a lot of these accomplish the same actions as the ones Jean made, but I do have a few new ones too.

13
General Discussion / Re: 2D animator
« on: January 13, 2014, 03:15:38 PM »
That's not what i mean bro. I know the difference between animator and animation.

Whats the difference between animator and animation?

 ???

14
Playmaker Help / Re: Vector Reflect in a Unity 2D (4.3) game
« on: January 12, 2014, 09:07:45 PM »
Hi,

I made this. Most functions seem to work but I haven't done a lot of testing.
Was easy to convert because most of the functions can implicitly cast to Vector2.

15
General Discussion / Re: Unity 2D and Physics 2D Support now available
« on: December 27, 2013, 08:16:16 PM »
This will make fixing the GetRayCastHit2dInfo action kind of difficult because it can't just store the RaycastHit2D - it also needs to store a reference to the input distance float separately so that can be factored into getting the distance.

Pages: [1] 2 3 ... 7