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

Pages: 1 [2] 3 4 ... 10
Mainly asking since I'm working on a script and I'd like to see if I can determine if a variable is set to "none" so as to set up some cases for the functionality I want to put together.

... P.s. I wish I hadn't been so intimidated by coding. This actually isn't as hard as I thought it'd be.

Share New Actions / Clamped simple movement.
« on: March 26, 2015, 01:45:31 PM »
EDIT: March 30, 2015. New version available... See linked comment.

EDIT: April 2, 2015. New version available.

So, I wanted a simpler way to clamp the movement of a player object than having to come up with a beastly system since clamping seems to be a very, very simple thing to do in code.

It's also my first actual action made so I am not 110% certain that it's perfect or what have you.

It similar to the translate action (which is what I picked apart to figure out how to do this one) but doesn't have relative or local space. It's a raw world-space translate. I guess I could add that in to another version but if you've needed a system like this then have fun.

It requires values in the boundaries (vertical and horizontal) since if it's all at 0 you won't move... Well, you might shift a tiny bit but the clamp will override that.

Forum Suggestions / Idea for sub-forum: Scripting help.
« on: March 23, 2015, 08:57:35 AM »
Kinda curious if this might be a worthwhile idea.

A sub-forum here on the site for discussion on making custom actions? So, if I wanted to find some assistance making a custom action there'd be a spot I can go to rather than the playmaker help section which seems more like a how-to for the system itself.

Having a section where someone can post for help making scripts isolated from the main section might be something that could help keep the boards a little cleaner maybe.

PlayMaker Help / How do I get a component from within a PM script?
« on: March 22, 2015, 01:40:18 PM »
Here's the code that I'm stumped on... I'm trying to use this to apply velocity to the object this is on (while keeping it clamped within a certain zone that the user defines.)

Code: [Select]
using UnityEngine;
using System.Collections;

namespace HutongGames.PlayMaker.Actions
[Tooltip("Simple movement of a character while constrained within a user-defined area.")]
public class ClampedMovement : FsmStateAction
public Rigidbody rb;
public enum AxisPlane


[Tooltip("The GameObject to move.")]
public FsmOwnerDefault gameObject;

[Tooltip("The movement vector.")]
public FsmVector3 moveVector;

[Tooltip("The world plane that the 2d input is mapped onto.")]
public AxisPlane mappedToPlane;

[Tooltip("Lateral clamp minimum value.")]
public FsmFloat horizontalMin;

[Tooltip("Lateral clamp maximum value.")]
public FsmFloat horizontalMax;

[Tooltip("Vertical clamp minimum value.")]
public FsmFloat verticalMin;

[Tooltip("Vertical clamp maximum value.")]
public FsmFloat verticalMax;

public override void Reset()
gameObject = null;
moveVector = null;
mappedToPlane = AxisPlane.XZ;
horizontalMax = 0.0f;
horizontalMin = 0.0f;
verticalMax = 0.0f;
verticalMin = 0.0f;

public override void OnEnter()
rb = GetComponent<Rigidbody>(); // <-- Here is where the error is showing up in the console.

public override void OnFixedUpdate()

void DoSetVelocity()
var go = Fsm.GetOwnerDefaultTarget(gameObject);

rb.velocity = moveVector.Value;

switch (mappedToPlane)
case AxisPlane.XZ:
go.transform.position = new Vector3 (Mathf.Clamp(go.transform.position.x, horizontalMin.Value, horizontalMax.Value), go.transform.position.y, Mathf.Clamp(go.transform.position.z, verticalMin.Value, verticalMax.Value));

case AxisPlane.XY:
go.transform.position = new Vector3 (Mathf.Clamp(go.transform.position.x, horizontalMin.Value, horizontalMax.Value), Mathf.Clamp(go.transform.position.y, verticalMin.Value, verticalMax.Value), go.transform.position.z);

case AxisPlane.YZ:
go.transform.position = new Vector3 (go.transform.position.y, Mathf.Clamp(go.transform.position.y, horizontalMin.Value, horizontalMax.Value), Mathf.Clamp(go.transform.position.z, verticalMin.Value, verticalMax.Value));


I know that offering a raw code dump like this might be a little intimidating but I think I've got the clamping mechanics down as that's not reporting any errors... I haven't been able to test it with a preview though since I'm coming up against an error at line 57.

What I'm hoping to do is just applying the velocity (I don't know if I have to add in a world-vs-self space thingamabob but for now I'm only working with it raw as is to see how it goes.)

I'm a bit stumped here. Anyone want to show me what I've got wrong? Is this some layer that I need to dig into since this is a PM action?

(edit: Wasn't sure if this would be more appropriate for Character or Physics in the category... That's a minor thing though.)

I'm finally getting off my @$$ and seeing about trying my hand at making a custom action. Mainly because it clicked, if I can put together a complex FSM then I DO have the head for programming in a sense... It's just a matter of knowing how to translate that from the FSM to a code-based approach (and to be fair I do have a decent amount of skill with MaxScript from my training and freelancing as a rigger and it's most definitely a programming language on it's own.)

So here's what I'm wondering. I'm trying to make a system that has movement for the player but clamps it within an area.

What I'm wondering is (and I suspect I'm overcomplicating it a bit) is this... Can I create a drop-down that auto-populates variables the user can input similar to the "Int Switch" action but instead of a number of int variables in that one it's a "Floats/Rect/Vector2" kinda deal?

So, say you choose the "Floats" in the drop-down... It then populates four float values you can input. In the case of the "Rect" it lets you pop in a rect variable and in the case of the Vector2 variable, it lets you do two vector2 vars (one for the minimum and one for the maximum.)

I know this might be biting off a lot more than I can chew since I'm not that skilled with C# but I think having those options would make it easy for someone to choose what they prefer if this is an action that is to be shared... All else failing that, I can work on the four floats thing but I would like to add in that extra functionality if at all possible (without making my computer catch fire, that is.)

Any actions you can suggest I look at (either stock or in the EcoSystem) to gauge what this is like or is this something that something unheard of so far?

PlayMaker Help / Constraining/Clamping/Restricting player movement.
« on: March 21, 2015, 01:13:14 PM »
Hello again... I'm trying to figure out an elegant system to see about limiting the player object's movement for a shmup that limits the player from moving outside of the boundaries of the screen.

I've got the data to feed it (where the boundaries of the screen are relative to the player's location in the scene) but I'm coming up against a wall on how to do this as elegantly as possible (without layering on too many FSMs on top of it.)

I'd like to avoid using rigid bodies if at all possible (box colliders at the borders of the screen that are set to prevent the player from moving outside of it.)

Anyone ever crack this one?

PlayMaker Help / Moving platforms help requested.
« on: November 30, 2014, 02:19:55 PM »
Like the title...

What I need to figure out is how I can get the player to move while they're on a moving platform and move with that platform... It's a standard game mechanic but I'm having a hard time adapting the video tutorial (which deals in code) to PlayMaker.

Here's the video I'm referencing. In code it seems relatively simple... But I'm having a difficult time wrapping my head around how I'm going to get this working using PlayMaker.

Attached is the way I've got it set up for now... The first shot shows the three actions that give me the custom gravity.

I've also got the "set velocity" being what drives the movement... I know it's a little odd but it's the cleanest way I could figure out how to do this since I was getting some really odd results with the "translate" and the character controller would throw some even odder results... So, I am somewhat limited in how I can approach this.

If you want to see other bits of this, feel free to ask and I'll do what I can.

As for how I have tried to address this... Well, I tried the suggestion in another thread to change up the parenting to make it a child of the platform while it's on there but that didn't give me nice results for what I wanted (when I tested I noticed a slight jumpiness as the parenting did it's thing.)

What I have to work with:
-I have a system that detects what it's standing on and determines what it is (if it's a moving platform or not) this uses raycasts. This system is also important to detect when it's grounded or not (since I had to scrap the use of the character controller component, I had to cobble together my own "is grounded" checking system... That is the same system that the "am I on a moving platform?" test uses so I'd rather not have to re-roll that element.

Any ideas? The biggest hurdle I've been trying to figure out is how do I calculate the movement of the platform itself to feed into the "movement = movement + platform movement distance" thing (as outlined in the video.)

I know this is long. Thank you for reading this far.

edit: Yes, this is for an asset store package but also for a game I want to make... That's kinda how I do that part of my side-job... Making games and also selling the bits and pieces for a little extra scratch. If the idea of helping with something I plan to monetize is troubling to you then I completely understand.

Action Requests / Is there an action to continually update a trigger?
« on: September 15, 2014, 12:43:32 PM »

I'm wondering if there's an action somewhere out there (or if one can be made, if possible) to have a trigger volume detected continually?

So, say this action is running... It's set to detect a trigger from a particular tag (assuming this object is going to be the one running into the tag) and update a boolean value (or another pertinent var but I think bool would be the ideal choice) as to whether that condition is met or not?

I know I could make another FSM that checks for that alone but I do want to try and keep this neat... I can work with that system for now but an action that would do something like this without having to transition to another state would be A+!

Edit: Though, is this something that the conditional expression action system would be able to work with or would it only be able to detect things like the usual variables? If it can handle trigger states, I'm all for that (I do love that action set! It's wonderful!)

General Discussion / Purchasing in bulk... For "gifts."
« on: September 13, 2014, 10:34:34 AM »
So... Can this be done?

Reason I ask is that I've been getting in touch with some people and I've been considering what it would take to get them a copy but as you can imagine if I can snag a couple extra licenses when it's on sale (I do have a businessman's heart it seems) would be far more cost-effective and sitting on those gift-codes until I have someone on team that I can send it to.

So, can it be done (that you're aware of) such that I could snap up three or four extra seat licenses when it's on sale and hold on to them for when they're needed?

If not, I can still do it one at a time... But if I can hold on to licenses that'd really help my budgeting.

PlayMaker Help / Wall-slides/jumps... What would you choose?
« on: August 24, 2014, 01:05:35 PM »
Hi again!

I'm now working on getting a wall-slide/jumping mechanic set up and I'm a little torn on what method would be the most ideal...

One method could be with making each wall that the player is meant to be able to slide down or jump off of having a trigger on it that tells the character systems that it's a slide-able/jump-able wall and use that trigger system to switch to the "wall slide" mode (which can be jumped out of or simply dropped out of after pressing the opposite direction.) The pros of this method would be that I suspect it'd be simpler in execution but the cons would be that each wall that the player is able to interact with will have to have a collider/trigger on it to tell the systems when to switch in and when to switch out.

Another method would be with some raycasts (only going out maybe a few pixels) that would be the firing mechanism to transfer to the wall sliding system... The pros of this system would be that it would be self-contained on the player object itself and would allow any wall to be slide-able (for the most part) but the cons would be it'd probably be a bit of a beast to set up and debugging might be a real pain in the rump... Not to mention that it'd be using raycasts (about two or three on each side of the player) so it may be a bit expensive.

I'm not sure which would be the most ideal so I'm wondering if you've had any experience with it what you would suggest?

Also, if what you'd do isn't listed here, how would you do it?

If it helps, it's not intended for mobile so I'm not too terribly concerned with CPU costs here.

PlayMaker Help / Is there a way to limit the FPS?
« on: August 10, 2014, 12:40:13 PM »
I know it seems like a really odd question but I've been working on the side-scroller and since it's using the every-frame to calculate the gravity that I'm trying to apply to the character, if the frame rate of how fast the "Every frame" fires off is different that's going to result in differences and variances...

And I also know that making it use my own custom gravity system is a little out there, it's because I just wasn't satisfied with the engine-specific gravity (too floaty... Even with the mass and other calculations changed/adjusted.)

So, is there a way to limit the every frame by limiting the FPS or something? I need it to be precise (or would this be where the "Fixed update" option for every frame executions would be a better solution?)

Yeah, it's an old galaxy tab that a roommate gifted me with when he upgraded. It's old, small and perfect for stress-testing for mobile development.

With that being said, I have no idea what direction to go in to figure out what kind of process I'd need to learn to be able to use PlayMaker to develop something with this.

So, who here that has experience with tablet/mobile development using PlayMaker? What direction would you suggest I (or anyone that's reading this and also wanting to know) go in?

This isn't really about what kind of game to make... It's more about what kind of things one would need to understand about developing for a mobile device that developing for the PC market might not really give them.

PlayMaker Help / Dis-inheriting scale (a rather "out-there" question.)
« on: August 03, 2014, 10:27:41 AM »
So, I'm asking this here because I'm looking to see if I can get a stretchy-bone system into Unity that has a hierarchy to it... Since scaling is inherited, that leaves the resulting rig a total mess.

Thing is, what I've been able to hash together is a system that will nullify that scaling by essentially dis-inheriting the scaling information of the parent.

The formula is basically:

ThisObject.scale = 1/ParentObject.scale

That works to reduce the scaling back to 1,1,1... But that over-writes any scaling I might have animated into the rig that that particular bone is doing (And it only seems to work with objects that are not scaled up or down. That isn't a big issue though because you can scale things in the import settings much more cleanly.)

What I want to do, assuming it's even possible, is to take from the animation track the scale of what it should be, take the parent scale and apply the inverse values only... So that the bone, if it's animated in scale, will still animate in scale but not inherit the relative scaling that it'd get from it's parent.

... Is something like this even possible with Playmaker? With Unity? I've tried using the "Get Property" action to peek into what data I could potentially extract for this but all I see is position and rotation... No scale (even though it does animate scaling at least with the generic setting of Mecanim.) I've even tried that with the legacy animation system and there's even less data I can extract with that (no position or rotation data at all.)

Anyone want to throw me a bone here? I'm kinda wondering what I can do because all my current examples hasn't resulted in the most reliable results... Mainly because all the actions that I know of to use for something like this would over-write the scale directly and that'd only work on the first frame... So, I'd need to get the data out of the animation system itself for what the scale is supposed to be for each bone that this system would affect each time this algorithm cycles through (so I can prevent any additive scaling messes.)

I'd like to formally request a set of actions that will allow me to convert a numerical value to/from the various modes like Binary, Hexadecimal, etc...

I have an algorithm that I've been nursing and I think it's about time I actually put into practice to see if it'd work as I hope it would... But it requires the ability to convert a binary number to and from an int (but the other modes would be helpful for other systems I suspect.)

Feature Requests / Have an "Automatically insert a 'comment'" feature.
« on: August 01, 2014, 12:43:58 PM »
So if you're not using the comment action, you're missing out. It's actually quite helpful in making sure that the systems are far, FAR easier to understand at a glance. Sure, it's one more action in the stack but it (afaik) doesn't do anything other than insert a comment so that you can understand the actions and what they do.

But I'm wondering if it's a possible option to have an option in the preferences where whenever you make a new state a comment action is automatically added in in each new state you make? A way to shave down having to hunt it down in the Action browser and have it automatically there for you to use (or copy/paste as needed.)

It's very much a low-priority thing but it might give one of those "Value added" things... A way to tell the user "Hey, we know that you might not want to have this but if you do then here's a simple way to comment your code and save time doing so!"

... Because, let's face it... If you aren't commenting your code chances are if you come back to it after a while you might be a little lost... Or you might alter something small that completely breaks your entire system... Or you might change an expression in the conditional expression... Or any team-members that you're working with might not easily understand what you're doing at a glance... Commenting your code I'd think is essential and it's something I've been trying to do religiously nowadays.

Pages: 1 [2] 3 4 ... 10