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.


Topics - cel

Pages: [1] 2 3
1
PlayMaker Help / running a Fsm template from script
« on: July 27, 2021, 10:31:59 AM »
hi, i've looked at the examples in the actions runFSM, runfsmtemplate and the one from the forums addtemplate

but all seem a bit complicated for me... I'm looking for something that simply lets you run a template from a script (no finished events, no everyframe, no send variables)... can someone help please?

Thanking you in advance...

2
PlayMaker Help / getting null result when assigning a variable
« on: July 16, 2021, 10:04:59 AM »
Hi,

trying to make a playmaker action for Gamecreator.
I'm having problems accessing the Gamecreator CharacterAttachments method, when trying to assign it i always get a null result. Can anyone with knowledge of Playmaker and Gamecreator have a look and point me in the right direction?

Thanks in advance,

Here's the code:

using UnityEngine;
using GameCreator.Characters;
using GameCreator.Core;
using UnityEngine.Events;


namespace HutongGames.PlayMaker.Actions
{

    [ActionCategory("GameCreator")]
    public class test1 : FsmStateAction
    {
        [RequiredField]
        [ObjectType(typeof(Character))]
        [Tooltip("Character to attach to")]
        public FsmOwnerDefault character;

        [ObjectType(typeof(HumanBodyBones))]
        [Tooltip("Bone where gameobject will be attached")]
        public FsmEnum Bone;

        [RequiredField]
        [Tooltip("Gameobject to attach")]
        public FsmGameObject objectToAttach;

        [ObjectType(typeof(Space))]
        [Tooltip("Space")]
        public FsmEnum space;

        [Tooltip("Position")]
        public FsmVector3 position;

        [Tooltip("Rotation")]
        public FsmQuaternion rotation;

        private Character _character1;
        private CharacterAnimator _animator;
        private CharacterAttachments _attachments;
        private GameObject _object;

        // Code that runs on entering the state.
        public override void OnEnter()
        {
            var go = Fsm.GetOwnerDefaultTarget(character);
            if (go == null) return;

            _character1 = go.GetComponent<Character>();
            _animator = _character1.GetCharacterAnimator();
            _attachments = _animator.GetComponent<CharacterAttachments>();
            _object = objectToAttach.Value;


            if (_character1 == null) Debug.LogError("no character");
            if (_animator == null) Debug.LogError("no animator");
            if (_attachments == null) Debug.LogError("no attachments");
            if (_object == null) Debug.LogError("no object");
           
            Finish();
        }
    }

3
PlayMaker Help / Question about hideif attribute
« on: December 25, 2019, 06:47:14 AM »
Hi,

I'm was trying to hide some elements of an action and I came across the hideif attribute in the api documentation, but it doesn't provide an example,  when typing the code it says it requires string and test...

Could anyone provide a little example on how to make this attribute work, I've searched in most of the actions in playmaker and I couldn't find one that uses this.

Thanks in advance

4
PlayMaker Help / question about linker wizard[SOLVED]
« on: December 24, 2019, 05:59:29 AM »
Hi,

I know that setting properties with the set property action may need then linker wizard if you want to export to android or ios,

but, having an action itself with the following code:

Code: [Select]
private void SetProperty()
        {
           storeValue.Value =  _character.characterLocomotion.canRun;
        }

will this qualify as a need to use linker wizard before compiling, even though is inside a question?

thanks

5
PlayMaker Help / help with action code[SOLVED]
« on: December 23, 2019, 07:03:17 AM »
hi,
I have a little problem with some actions i'm making to interact with game creator.

I have the following code:

Code: [Select]
using UnityEngine;
using System.Collections;
using GameCreator.Variables;
using HutongGames.PlayMaker;

namespace HutongGames.PlayMaker.Actions

{
    [ActionCategory("Game Creator")]
    [Tooltip("Get a GameCreator local bool Variable value to PlayMaker.")]
    public class GetGameCreatorLocalBoolValue : FsmStateAction
    {

        [RequiredField]
        //Game Creator object with the local variable
        [Tooltip("Game object that contains GameCreator local bool variable.")]
        public FsmGameObject gameCreatorObject;

        [Tooltip("Look for GameCreator variable bool in game object's children.")]
        public bool lookInObjectChildren;

        [RequiredField]
        //Game Creator name (bool) to import from
        [Tooltip("Name of the GameCreator local bool variable")]
        public FsmString gcBoolName;

        [RequiredField]
        //Choose which PlayMaker bool to import value to
        [Tooltip("Store the GameCreator bool variable in a Playmaker bool variable")]
        public FsmBool StoreValue;

        public bool everyFrame;


        //Declare float variable
       private bool var;


        public override void Reset()
        {
            //Reset
            StoreValue = null;
            gcBoolName = null;
            gameCreatorObject = null;
            lookInObjectChildren = false;
            everyFrame = false;

        }

        public override void OnEnter()

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

        }



        //Get variable function from Game Creator
        public bool GetVariable()
       
        {
         
            object result = VariablesManager.GetLocal(gameCreatorObject.Value, gcBoolName.Value, lookInObjectChildren);
            return (bool)result;
         
           
        }

       
        public override void OnUpdate()
        {
           
            //Call get function and save to variable var     
            GetBool();

        }
        private void GetBool()
        {
            if (gameCreatorObject == null) return;

            if (StoreValue == null) return;
           
            GetVariable();
            var = GetVariable();
            StoreValue.Value = var;
        }

    }
   
}


everything works just fine, but the action has a little something that is bothering me and I can't get rid of it. The store value should only list the variables, not the tick box, How do I get rid of it? please see the picture attached

any help appreciated,

thanks

6
PlayMaker Help / Load from file action help
« on: November 27, 2019, 01:45:12 PM »
Hi, I'm using the load from file action and it's working great, but I want the file path to always point at a directory inside the unity project, something like apppath$/test/example.file, is this possible?


Also this is the text I'm getting:
<config>
       <var name="marker"><![CDATA[1]]></var>
</config>

How do I parse the text so that I get the number in [ ] in the cdata?

Any help would be greatly appreciated

Thanks in advance

7
PlayMaker Help / datamaker xml help
« on: November 26, 2019, 04:01:58 AM »
Hi,

I'm trying to access an xml file outside my project's directory, so it's located somewhere else, how do access it with datamaker?
Maybe someone could put up a little picture on how to do it?

Thanks in advance

8
Share New Actions / create primitives at runtime
« on: June 09, 2019, 06:19:40 AM »
Based on the code from create object advanced here are 5 actions that let you create primitives at runtime (cube,plane,sphere, cylinder and capsule). Big thanks to Deek for finding and correcting the bugs and tidy up the code.

9
PlayMaker Help / help with custom action [SOLVED]
« on: June 06, 2019, 01:35:58 PM »
I copied the action create advanced code in order to create primitives, it works but, when i change the spawn position (x=2,y=0,z=0) it creates two primitives. Could someone have a look at the attachment and find out what is going on wrong?

10
Action Requests / action for speech recognition (windows,uwp)[SOLVED]
« on: March 21, 2019, 04:43:56 AM »
Upon reading this https://lightbuzz.com/speech-recognition-unity/ would it be possible to make an action that let us define and add the words we want recognised and then fire an event?

thanks

11
Action Requests / actions for the new physics update
« on: January 31, 2019, 08:07:40 AM »
Hi,

Would it be possible to get actions for the new physics update, like for example the PhysicsScene methods and maybe a tutorial about simulations??

Thanks

12
General Discussion / Tiny runtime?
« on: December 21, 2018, 04:21:14 AM »
Just wandering if you guys are planning in supporting the tiny runtime?

thanks

13
PlayMaker Help / issue with rotating/moving platforms
« on: February 27, 2018, 09:14:42 AM »
I have a rigidbody that goes trough a rotating platform on the y axis and I want the rigidbody to stay in the platform and follow the platform rotation... but it always slides down... I had a look at the samples from the ecosystem rigidbodyplatformmovemnt, but these seem not be working either. I'm using the latest Playmaker and unity 2017.3.0f3.
Does anyone know how to achieve this?

14
PlayMaker Help / help turning script into playmaker fsm [SOLVED]
« on: February 01, 2018, 09:24:59 AM »
hi guys,

I'm having trouble in turning this script into a playmaker fsm, I just can't grasp the script at all. Could any of you guys have a look and see if you can make an fsm that does the same.

code:
Code: [Select]
using UnityEngine;

public class BallBouncer : MonoBehaviour
{
    [SerializeField]
    [Tooltip("Just for debugging, adds some velocity during OnEnable")]
    private Vector3 initialVelocity;

    [SerializeField]
    private float minVelocity = 10f;

    private Vector3 lastFrameVelocity;
    private Rigidbody rb;
   
    private void OnEnable()
    {
        rb = GetComponent<Rigidbody>();
        rb.velocity = initialVelocity;
    }

    private void Update()
    {
        lastFrameVelocity = rb.velocity;
    }

    private void OnCollisionEnter(Collision collision)
    {
        Bounce(collision.contacts[0].normal);
    }

    private void Bounce(Vector3 collisionNormal)
    {
        var speed = lastFrameVelocity.magnitude;
        var direction = Vector3.Reflect(lastFrameVelocity.normalized, collisionNormal);

        Debug.Log("Out Direction: " + direction);
        rb.velocity = direction * Mathf.Max(speed, minVelocity);
    }
}

and the attachment has the project

15
PlayMaker Help / request - calculate trajectory asset actions
« on: August 22, 2017, 09:58:37 AM »
hi guys,

would someone be able to make actions for this free asset https://www.assetstore.unity3d.com/en/#!/content/84341
namely get/set time between step, step count, added v, added f and instead of key to activate have an event to activate?

Thanks in advance,

Pages: [1] 2 3