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

Pages: 1 2 [3] 4
PlayMaker Help / Re: Teleport an object on Keypressed
« on: July 28, 2018, 07:34:36 AM »
Instead of a Move action with 0 time, try a "Set Position" action.


I took a look into that action and got to say that more than the lack of an OnEnter, what confuses me there is the use of: "OnActionUpdate()"

I had no idea of that instead of just OnUpdate() and can't seem to find any clue about it on the wikis.

Is OnActionUpdate() the same as OnUpdate() or something more, thus the no need for OnEnter?

PlayMaker Help / Re: get position between two targets
« on: July 27, 2018, 07:16:45 AM »
You can do that with simple vector math:

Vector A + Vector B = Vector AB
Vector AB / 2 = Vector C

Being vector C the middle point between A and B.

PS: Don't forget to use local position if you're working with a local space.

PS2: I've been forcing myself to look into code and try out / learn new things, so I took this as a "exercise" and created this noobish (yet seems to be working) action to find a mid point between two objects (vector3).
Attached it to the post and it does seem to be working here.

Hope it helps ;)


 is it not actually because your index is out of range or some other issues? watch out for the meaning of this action, it means you want to "SET" not "ADD", so if your array is empty, setting index 0 won't work.

 make sure you add an event for each potential issue this action throws, this way you will make sure you are setting it up properly.

I tested here and it all works.


I mentioned it just add string value in global variables windows but I need that value to global variables in project windows. I need when I stop game global variable keep that string!

If I'm understanding it right, you want to keep the value in the editor after runtime?
If so, the easiest way for that would be to store that string as a PlayerPref. Those will be kept after runtime.

Feature Requests / Re: FsmButton
« on: July 25, 2018, 06:29:55 PM »
If I understand you right, you're looking for something like a menu with several "toggles" to activate or deactivate options/elements.

Have you looked into uGui checkbox (unity ui)?
With it and "uGui Proxy Full" action package you can set that quite easily (specially with the proxy component)

Here's an official (bit old tho) video with a "how to"

PlayMaker Help / Re: Creating a .txt file? [SOLVED]
« on: July 25, 2018, 09:30:15 AM »
So, I was using this modification until I found out it would break on build.
I've added a couple of "#if UNITY_EDITOR"'s in it to make it work for builds (as atm it will only work on the editor).
I'm actually pretty clueless about coding but this seems to work.

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2014. All rights reserved.
/*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/

using UnityEngine;
using System.IO;
using UnityEditor; //<- added to make the AssetDatabase available.

namespace HutongGames.PlayMaker.Actions
[Tooltip("Write string to a File")]
public class WriteToFile : FsmStateAction
[Tooltip("Set the file path, for example : Assets/myfile.txt")]
public FsmString filePath;

        [Tooltip("The text")]
public FsmString text;

        public FsmEvent successEvent;
        public FsmEvent failureEvent;

        public override void Reset()
filePath = null;
text = null;


public override void OnEnter()
            if (File.Exists(filePath.Value))
                // Create an instance of StreamWriter to write text to a file.
                StreamWriter sw = new StreamWriter(filePath.Value, true);
                //Stream Writer will create the file automatically
                StreamWriter sw = new StreamWriter(filePath.Value, true);

                //re-import file and reference in editor

                //Check to see if file was created successfully
                if (File.Exists(filePath.Value))
                    Debug.Log("New File Made");
                    Debug.Log("Error: File not created");

PlayMaker Help / Re: Saving Screenshots Folder
« on: July 25, 2018, 09:27:27 AM »
Well, darn. I'll just add another reply since the above one was getting confused.

I thing I solved my issue with the use of well located "#if UNITY_EDITOR" in that modified SaveToFile action.
I'll just go ahead and post "the fix" on that thread.

PlayMaker Help / Re: Saving Screenshots Folder
« on: July 25, 2018, 08:36:11 AM »

 yes that works, but you are aware this is not working when you build right? this is only during editing time.



I had no idea. :(
I went back to that half-project and tried to build it and, oh boy...

Not only that wouldn't work (I trust it wouldn't) but I also couldn't build due to a build error on WriteToFile action that outputs a:
Code: [Select]
Assets/PlayMaker Custom Actions/Files/WriteToFile.cs(56,17): error CS0103: The name `AssetDatabase' does not exist in the current context

I'm a bit loss with this, I recon.

EDIT 1: So, I removed the WriteToFile action from my project, created a new scene and added nothing but a gui text (actually, a gui textmeshpro) that would update it's text with that "application path" action I posted above.
the result (after Build and Run) was (unexpectedly) correct (scrnsht added). Is that weird?
(note: the build was indeed built to that path minus the "*_Data\" ofc)

EDIT 2: So, the ecosystem WriteToFile.cs seems to be all good, with exception that it does not create new files. Because of that I was/am using a modification of that action that I got here (bottom of thread):
Well, that action seems to be working fine in editor but can't build it (due to the error pointed above).

So... I'm even more lost now.
Should I start another thread for this WriteToFile issue?

PlayMaker Help / Re: Saving Screenshots Folder
« on: July 24, 2018, 01:19:31 PM »
Hi, not long ago I crossed a similar issue and I kinda put together an action to help me with that (attached).
Note that I have barely any clue about coding. This seems to be working for me. No idea if the action's code is "ideal".

It will return the application path as a string (OnEnter).
You can then use something like Build String action to add the Screenshots folder to it.

Ofc this would only be valid if I understood right and "local folder" is a folder inside the "install" folder. :)

PlayMaker Help / Re: Camera Permission for Android
« on: July 24, 2018, 10:50:50 AM »
I got a reply from stan's Assets.
We will think about it. Our customers don't ask about this implementation. So, when they will ask us about it, We will start to implement it.

Best thing is to contact them again and specifically ask for "Runtime Permissions Actions"

in the worst case i can try to make some actions for you to use.

I'm sorry for reviving an year old topic, but this seems to be the only thread about this particular topic around here.
I do own Stan's Assets Android Native Plugin but it seems that it's been over a year and that kind of actions were not introduced yet (and judging by some recent reviews I'm not sure they'll ever be).

Did this actions ended up being created or is there an alternative for achieving this (getting permissions in runtime)?

Share New Actions / Re: Textmesh Pro Playmaker Actions (free)
« on: July 24, 2018, 09:01:42 AM »
Yes that can be done :)

Could you add these 2 lines to each action :
Code: [Select]
/*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
// Url :

I saw some uGui actions there.
Is the uGUi package required for the uGui action.
If so, is it possible to convert (or make new ones) for the build-in UI ?
If not, can they be renamed to UI instead of uGui for better clarity (only for the Ecosystem package, it's probably better to keep yours on github)

I think the reason they are name uGui is because of the old legacy UI action still present that are called just UI.

PlayMaker Help / Re: Best way to Limit Rigidbody 2D velocity?
« on: July 23, 2018, 12:10:49 PM »
How is the velocity set/added to the character.  (how does the character move)

i think the movement is interfering with the clam fsm you made.

The only other FSM that sets velocity every frame only deals with the horizontal (X is set to none and not 0). Just in case I didn't make this clear, the FSM I posted does actually work in clamping the velocity, it's just I'm pretty sure it's doing it in Update, and not FixedUpdate. Shouldn't physics related code by done in FixedUpdate?

Just for curiosity, why are you using a "set property" in there instead of a "Set Velocity 2d" action?
PS: just checked that action code and indeed the "every frame" option is set as a FixedUpdate.

PlayMaker Help / Re: Best way to Limit Rigidbody 2D velocity?
« on: July 23, 2018, 09:13:27 AM »
I'm a complete noob on all this but there's this action "SetVelocityConstantSpeed2d".

Could you possibly call it with the correct value at the moment that the player/object reaches it's terminal velocity?



use Fsm.KeepDelayedEventsOnStateExit = true;

If you need a custom action for this ( if you don't know how to code), let me know, I'll do it.


Oh. I've been activating gameobjects that then self-deactivate with a Wait and Send Delay for that.
An action to avoid using those GOs for delayed events would be awesome.

PlayMaker Help / Re: Instanced objects won't send collision events
« on: July 18, 2018, 08:13:44 PM »
Oh, sorry. I completely missed that you were using Trigger Colliders. Strange indeed then.
Just to make sure, i did try it (a couple of overlapping cubes with trigger collider and kinematic rigidbodies) and the "trigger event" action worked fine when activated the cube with the fsm. (almost clean project)

GL with finding a solution, and if you find what's causing that, please share it. I'm curious about the why.

Pages: 1 2 [3] 4