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

Pages: [1]
1
Playmaker Help / Leap Year
« on: May 13, 2015, 11:48:52 PM »
I was looking for a way to detect if a given year is leap or not (along with some other useful date functions) but found none, so I tried to make a custom action:

Code: [Select]
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("Date")]
[Tooltip("Determines if a given year is leap or not")]

public class LeapYear : FsmStateAction
{
[RequiredField]
[UIHint(UIHint.Variable)]
[Tooltip("Stores the year to test as an int")]
public FsmFloat yearToCheck;
[RequiredField]
[UIHint(UIHint.Variable)]
[Tooltip("Shows if the year is leap as TRUE")]
public FsmBool isLeapYear;

public override void Reset()
{
yearToCheck = null;
isLeapYear = null;
}

public override void OnEnter()
{
if ((yearToCheck % 4 == 0) && !(yearToCheck % 100 == 0) || (yearToCheck % 400 == 0))
isLeapYear = true;
else
isLeapYear = false;
Finish ();
}
}
}

It seems, however, that the mod operator is not supported... Any ideas?

Thank you.

2
Playmaker Help / Compound Float Compare Help
« on: May 06, 2015, 02:19:16 AM »
Hello.

I'm trying to implement a "Season" FSM in which a float value in the range 0, 359 is used to determine the current season (0-89 is Spring, 90-179 is Summer, 180-269 is Autumn and 270-359 is Winter).

Another FSM calculates the float value and send it here via Set FSM Float Value. The value is received correctly but yet it does not get evaluated.

In C#, the code is rather simple:

if(fVal >= 0f && fVal < 90) Debug.Log("It's Spring!");
if(fVal >= 90 && fVal < 180) Debug.Log("It's Summer!");
if(fVal >= 180 && fVal < 270) Debug.Log("It's Autumn!");
if(fVal >= 270 && fVal < 360) Debug.Log("It's Winter!);

Any ideas on how to implement this as an FSM?

Thank you.

3
Playmaker Help / [SOLVED] Passing values between FSM in the same object?
« on: November 06, 2014, 08:34:54 PM »
I have an FSM to setup things to be used at a later time, but when I try to GetFSMFloat, the action does not return anything and end with an empty value.

For instance, I have several FSM that do things with the camera but need to know the height, distance and a few vectors and quaternions to perform its duty. If I declare these variables in each FSM and then need to change the height value, for instance, I'll have to do it in each one of them. But if I put the configurable values in one FSM, then all the others could poll these values unaided.

My guess is that the Configuration FSM and the others are running at the same time and therefore could be reading the values before they are updated. Is there a way to poll those values after they have been initializated?

4
Playmaker Help / [SOLVED] PlayMakerAnimatorProxy?
« on: November 05, 2014, 04:01:19 PM »
Hello.

I'm trying to use the SetAnimatorIKGoal but I get a warning saying: This action requires a PlayMakerAnimatorIKProxy. It may not perform properly if not present. A search here does not produce results as to what is a PlayMakerAnimatorIK Proxy or how to create one. Could someone shed some light on this topic?

Thanks!

5
Playmaker Help / SET Quaternion?
« on: November 03, 2014, 08:11:44 PM »
I want to store several quaternions in global variables to be used as needed in my game, but there is no equivalent action like SetVector3XYZ. Is there any other way to accomplish this?

Thank you!

6
Playmaker Announcements / Unity 4.6 and Canvas Actions?[SOLVED]
« on: November 01, 2014, 06:08:20 PM »
Hi.

I'm playing with Unity 4.6 and its new GUI canvas. Are any Playmaker actions available for this?

Thank you!

7
Playmaker Help / Help with character controller issues...
« on: November 01, 2014, 02:06:02 PM »
This is not really a problem related to Playmaker per se, but maybe the community can provide me with their suggestions about how to solve it.

Is a simply setup: some skinned mesh with a character controller, a rigid body, an animator controller and FSM to provide the Horizontal and Vertical axis values to the animator in order to produce locomotion. The animations are taken from one of the Unity Tutorials and include a WalkBack, WalkBackLeft and WalkBackRight animations.

I added a Grounded check and noticed that when Walking Backwards, IsGrounded is false and switching between true and false with all other animations. The character mesh is 1.70 meters tall, so its center is at 0.85 meters, and all objects are zeroed and sitting flush to the ground. I hit play and the character jumps up about 5 centimeters, so I move the center of the character controller until the mesh no longer falls trough the plane floor but its feet are touching the ground. This solved the looks, but as the IsGrounded check still is false, the character falls when trying to Walk Back. A capsule collider instead of a character controller gives me the same problem...

I've checked the character meshes and the animations, used others and still have the same IsGrounded problem. Any ideas?

Thank you.

8
Playmaker Help / [SOLVED] ScreenToWorldPoint Jittering?
« on: October 16, 2014, 02:02:03 AM »
I have a simple FSM that reads the Mouse X and Y position at a determinated Z position (ten meters away from the camera). Converting that Vector3 to a point inside the game should be easy when using the ScreenToWorldPoint function, which returns a World Vector3, but for some unknown reason the Y component keeps moving randomly even when the mouse is static and basically it starts to fall down from where the mouse is pointing.

Any idea on how to solve this?

Thank you.

9
Playmaker Help / How to select a random transform within a NavMesh?
« on: August 06, 2014, 01:23:32 PM »
Hello.

My scene has a grid of roads, sidewalks and buildings, each in its own layer, and a navmesh for the roads has been defined. I want to randomly spawn cars over the roads only, but for that I need a valid vector3 range or the cars would be spawned all over the other layers as well.

Any idea?

Thank you.


10
Playmaker Help / [SOLVED] Modulo Operator
« on: August 01, 2014, 03:47:25 PM »
Uh... I was trying to do some math calculations but I couldn't find a mod operator in floats or ints.

Any suggestion?

Thank you.

11
Playmaker Help / Aiming Routine Help
« on: May 12, 2014, 05:04:46 AM »
Hello to all.

I have a setup in which the camera always follows my character from behind and I need it to aim to where the cursor or reticle is located. All the aiming routines I've checked, assume the target will be at the center of the screen or rotate the character to compensate this. The character is a GameObject which contains the mesh and the camera, along the FSM's to control its locomotion. I've set the main camera the get its position and the coordinates of the mouse at the X and Y axes. I've even made it to calculate the Screen to World Points and store its World vector, but I'm not really sure how to proceed.

Any advice will be greatly appreciated.

Thank you.

12
Android Help / Unity Dual Joystick Output to PlayMaker FSM: How to?
« on: April 12, 2014, 05:05:33 AM »
Greetings.

I have a basic scene in Unity: plane, light, camera, character and Dual Joystick prefab from Standard Assets (mobile). Using a remote controller installed in my Android device, I can control the joysticks and I have changes in the X-Y position of the control, as I can see in the Inspector.

My question is how can I pass the values at the Joysticks to an FSM in order to use them? Something like:

posx = left.joystick.position.x

Thank you.

Pages: [1]