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 - krmko

Pages: [1] 2 3 ... 6
Hi guys,

i have an identical FSM in all of my enemy prefabs that adds a number (int) to an arraylist when the enemy enters the screen, and removes an item when the enemy goes out of the screen. It works flawlessly except on one prefab that reports an "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" error.

I don't get it, it's a completely same action (array list add) with completely same parameters on all objects.

Any ideas?

Hi guys, here's what's going on. I use Get Key Code to String to get keyboard input and store it into string. Works perfect when i store it into local variable, but whenever i try to set it into global variable it does not work.

- I tried saving it to local variable, then to global from that local variable, nothing
- I tried buidling the string from local variable into another local variable and then try setting the global variable, nothing
- Splitting everything into multiple states, nothing

No errors are being reported, it just doesn't work.

Unity 2018.3.7f, Playmaker 1.9.1b4

Playmaker Help / Cycling through resolutions in array list [SOLVED]
« on: February 18, 2019, 12:42:16 AM »
Hi guys,

when i fire up the game, i get the screen height and width and save it into vector3 as a current resolution variable, which is then set as a string that will show up in the video menu when i go into it. Now, i've got a vector3 arraylist of resolutions, how can i iterate through the array by using the current resolution as an index that will be used as a pointer to get next or previous resolution from the array?

Playmaker Help / Create object advanced action issue [SOLVED]
« on: February 09, 2019, 09:25:02 AM »
Whatever i do, objects are being instantiated at z=1 position. Prefabs have z=0, they do not instantiate parented, object that instantiates them is at z=0.

Settings are world position stays = checked, set active = checked. I tried overriding  the position with z=-1, but it still spawns at z=1.

Any ideas?

Playmaker Help / Question about FsmVar
« on: February 04, 2019, 12:11:25 PM »
Hi guys,

I have an issue, but i need to know how some things work to know how to solve it.

I'm using get array list random to get a random GameObject from array list. Now, when  i instantiate that object with Create Object Advanced it's ok, but when i use Core Game Kit and set the GameObject to spawn it spawns the wrong thing.

I suppose FsmVar is changeable variable that sets its type depending on the type of variable in the action by using PlayMakerUtils.ApplyValueToFsmVar, but why doesn't it work in things like Core Game Kit?

I'll dig up the code to the action of CGK to see how it's handled there, but isn't FsmVar automatically converted to GameObject variable in the Get Array List Random action?

Any ideas what does this mean? It appears as an error for array maker proxy and it does not cause any trouble, but it's annoying and i want to know what's going on.

Code: [Select]
ArgumentException: At least one object must implement IComparable.
System.Collections.Comparer.Compare (System.Object a, System.Object b) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Array+SorterObjectArray.SwapIfGreaterWithItems (System.Int32 a, System.Int32 b) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Array+SorterObjectArray.PickPivotAndPartition (System.Int32 lo, System.Int32 hi) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Array+SorterObjectArray.IntroSort (System.Int32 lo, System.Int32 hi, System.Int32 depthLimit) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Array+SorterObjectArray.IntrospectiveSort (System.Int32 left, System.Int32 length) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
Rethrow as InvalidOperationException: Failed to compare two elements in the array.
System.Array+SorterObjectArray.IntrospectiveSort (System.Int32 left, System.Int32 length) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Array+SorterObjectArray.Sort (System.Int32 left, System.Int32 length) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Array.SortImpl (System.Array keys, System.Array items, System.Int32 index, System.Int32 length, System.Collections.IComparer comparer) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Array.Sort (System.Array keys, System.Array items, System.Int32 index, System.Int32 length, System.Collections.IComparer comparer) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Array.Sort (System.Array array, System.Int32 index, System.Int32 length, System.Collections.IComparer comparer) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Collections.ArrayList.Sort (System.Int32 index, System.Int32 count, System.Collections.IComparer comparer) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Collections.ArrayList.Sort () (at <ac823e2bb42b41bda67924a45a0173c3>:0)
HutongGames.PlayMaker.Actions.ArrayListDeleteDuplicates.ArrayDelete () (at Assets/PlayMaker Custom Actions/ArrayMaker/ArrayListDeleteDuplicates.cs:248)
HutongGames.PlayMaker.Actions.ArrayListDeleteDuplicates.doesArrayListContainsCount () (at Assets/PlayMaker Custom Actions/ArrayMaker/ArrayListDeleteDuplicates.cs:102)
HutongGames.PlayMaker.Actions.ArrayListDeleteDuplicates.OnEnter () (at Assets/PlayMaker Custom Actions/ArrayMaker/ArrayListDeleteDuplicates.cs:67)
HutongGames.PlayMaker.FsmState.ActivateActions (System.Int32 startIndex) (at C:/Projects/Playmaker_merge/playmaker_unity/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState.CheckAllActionsFinished () (at C:/Projects/Playmaker_merge/playmaker_unity/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:572)
HutongGames.PlayMaker.FsmState.OnUpdate () (at C:/Projects/Playmaker_merge/playmaker_unity/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:268)
HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state) (at C:/Projects/Playmaker_merge/playmaker_unity/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2808)
HutongGames.PlayMaker.Fsm.Update () (at C:/Projects/Playmaker_merge/playmaker_unity/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2009)
PlayMakerFSM.Update () (at C:/Projects/Playmaker_merge/playmaker_unity/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:579)

Playmaker Help / Stop multiple weapons from firing at the same time
« on: November 29, 2018, 12:51:38 PM »
I'm going bald from this, someone please help  ;D

I have three weapons, each starts firing by pressing x, y, z, so i'll call them like that, weapon x, weapon y and weapon z.

I made a neat little fsm for controlling weapons, so when i'm firing with x, let go of the button and press y, weapons switch and y starts firing.

However, to do that, i needed to put get key y, z to state where x is firing, get key, x, z when y is firing and get key x, y when z is firing so weapons can switch without the need for letting go of the buttons.

But the problem is that multiple weapons can fire simultaneously that way and i don't want that, i want only one weapon to fire at a time.

I can solve this by putting mid state in which you enter when you let go of the firing key x, y or z and the you press the button you want, but it's too slow and most of the player actually hit the button for firing the new weapon while they are still holding the button for firing the last one.


If i recall, i used to be able to sort the array list and remove the duplicates and then simply copy/paste the values to the array list to keep it nice and tidy. Unfortunately, that doesn't work anymore.

Any ideas how to handle this problem?

I'm on latest unity beta and latest playmaker beta.

Hi guys,

i don't know if anyone's using the Simple Waypoint System plugin (i heartly recommend it), but i have an issue with one of the actions. Apparently, by popular demand, instead of choosing the game object that should receive the event by referencing the game object/fsm variable, it is a drag and drop field for the game object instance, which is silly and cannot be used properly.

Here's the code, it's quite small:

Code: [Select]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using SWS;

//implements a PlayMaker FSM method call via event insert
namespace HutongGames.PlayMaker.Actions
    [ActionCategory("Simple Waypoint System")]
    [Tooltip("Adds an event to a walker object for calling your own FSM state at waypoints.")]
    public class SWS_AddEventAtWaypoint : FsmStateAction
        [Tooltip("Walker object")]
        public FsmOwnerDefault walkerObject;

        [Tooltip("Waypoint index")]
        public FsmInt wpIndex;

        [Tooltip("Receiver with the FSM event")]
        public PlayMakerFSM fsmReceiver;

        [Tooltip("Receiver FSM event to call")]
        public FsmString fsmEvent;

        public override void Reset()
            walkerObject = null;
            wpIndex = null;
            fsmReceiver = null;
            fsmEvent = null;


        public override void OnEnter()


        void Execute()
            var go = Fsm.GetOwnerDefaultTarget(walkerObject);
            if (go == null) return;

            List<UnityEvent> events = null;

            splineMove spline = go.GetComponentInChildren<splineMove>();
            if (spline)
                events =;
                navMove nav = go.GetComponentInChildren<navMove>();
                if (nav)
                    events =;

            UnityEvent myEvent = events[wpIndex.Value];
            myEvent.AddListener(delegate { fsmReceiver.SendEvent(fsmEvent.Value); });


This is the culprit: 

[Tooltip("Receiver with the FSM event")]
public PlayMakerFSM fsmReceiver

I tried messing around by trying to insert stuff from send event action, but i'm not quite good with Playmaker API, i'd appreciate some help :)

Playmaker Help / Asteroids game - problem with movement [SOLVED]
« on: October 29, 2018, 05:31:50 AM »
Hi guys,

i'm playing around a bit with this Asteroid game tutorial ( and i'm doing everything i should in it, but my movement is still not good.

This is how the setup looks from the tutorial video.

And this is what i get, the force is constantly applied upward instead of forward.

Any ideas? I suppose it's a quick fix for someone who knows what he's doing, i'm not so good with vectors and force.

Playmaker Help / Get Next Child Or Set Parent Not Working Properly
« on: October 15, 2018, 08:28:56 AM »
I've got a simple FSM consisting of:

1. Get next child, store it under 'child'.
2. Set parent of 'child' to none.

Repeat until all children are detached.

But, of 7 objects i have childred, not all are being detached. Any ideas? Seems like a bug.

Good old dumb find child/set parent to none works, this somehow fails.

Unity 2018.3b5

I played with FlowCanvas and Bolt a bit lately, there's a neat thing that Playmaker doesn't have and which is useful.

In both of those solutions, when you click on the transition, draw the arrow from it and don't connect it to an existing state but release the button while on empty space in graph, it creates an empty state and automatically connects to it.

A nice bonus would be to automatically select the state name so you can it type in the name as soon as the state is created.

Feature Requests / Improved prefab workflow support
« on: September 21, 2018, 12:36:55 PM »
Hi guys,

since 2018.3 is finally out, i got to delve a bit deeper into whole improved prefab workflow. When you edit the FSM on the object in the scene you will get the usual "Editing the FSM can disconnect if from the Prefab FSM" dialogue.

Now, when you click EDIT PREFAB, graph view of the FSM will open, the Prefab highlighted in the project view, but you won't be actually editing the Prefab but the INSTANCE since the prefab is not opened, as shown in the screenshot.

I guess you'll get to it eventually, just wanted to let you know.

Feature Requests / Copy multiple variables
« on: September 21, 2018, 12:29:16 PM »
Hi guys, i just noticed that i'm unable to copy multiple variables from one FSM to paste them to another. I can only copy then paste one by one. Not that i need it that much since now is the first time i even noticed it, but it seems to me that it is kind of counterintuitive or accidentally overlooked since you can copy multiple actions or states, but not variables.


Playmaker Help / Friendly reminder to everyone using Unity 2018.3 beta
« on: September 21, 2018, 04:20:30 AM »
Nested prefabs are truly great and i believe many of you have probably started using the new beta. I had a lot of trouble with crashes and instability, and even when i got rid off all the errors, warnings, unused scripts, bad references and so on, the problem persisted, so i thought the problem may be in Playmaker.

It isn't.

Set Scripting Runtime Version to .net 4.x and you're good to go.


Pages: [1] 2 3 ... 6