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 - Adam Z

Pages: 1 [2] 3 4 5
16
I'm setting up a simple time-of-day.  I have 2 directional lights, that are facing opposite directions. One is for the sun, and the other the moon. I have 2 states; Sun and Moon.  My Direction Light rotates over time, and when it hits 0 on the X axis, I want it to go to another State. 

Right now I'm using a Float Compare, with Float One as the X rotation of the light that gets updated every frame, and Float 2 is at 0, with a tolerance of 0.1.  When the light rotates to 0 it should transition to the other state, but I get loop count error:
"Loop count exceeded maximum: 1000 Default is 1000. Override in Fsm Inspector."

What am I missing, or is there a better way to set this up? 

Thanks.

17
PlayMaker Help / Pie or Radial Menu that works with U Gui Component Proxy?
« on: November 22, 2016, 02:59:52 PM »
Does anyone know of a radial or pie menu asset that works with Play Maker U Gui Component Proxy? I just picked up UPie Menu and it doesn't seem to work.

Thanks.

18
PlayMaker Help / How to create a Raycast Line of Sight system?
« on: October 25, 2016, 08:37:31 AM »
After previous discussions months back, it probably was a good idea to detect if the NPC is close enough to the player AND looking in their field of view before sending a Raycast. If so, then shoot a Ray at the player to see if there are any obstacles in the way. Sebaslive suggested:

"taken from the unity answers:

You want to calculate the direction between the enemy and the player, get the forward vector of the enemy, and then use Vector3.Angle to calculate the angle.

Then you can check if the angle is less than whatever angle you want to be the enemy's field of vision (eg: a 20 degree cone, for instance), and if it is, then the player is in that enemy's field of vision.
----
so in playmaker terms, use the vector3 operator, set up two vector 3 variables and set it to Angle. Get the players vector3 and if it is in that range you use "You can Store Magnitude in Get Axis Vector and use Float Compare on that..."

and that is another way to do it!"

My Raycast works fine by creating an empty Game Object, parenting that to NPC, and adding a Look At, Raycast, and Game Object Compare Tag to determine whether the Ray hit the Player or another object such as a wall, then sending the result to an Event.

The problem I'm having is figuring out the Line of Sight like Sebaslive suggested.  I have a state prior to the Raycast State that Gets Position of both the NPC and Player. That gets inputted into the Vector3 Operator. I set the Operation to Angle, but I'm not sure what I need to do next. I can use a Float Compare, but that will still allow for detection if the Player is behind the NPC.  Maybe there's a better way to do it?

Any help would be appreciated. Thanks!


19
PlayMaker Help / How to move a game relative to the direction of another?
« on: October 19, 2016, 07:58:58 AM »
I have a two bone system; bone A and B.  Based on the direction bone A is facing, I would like to move bone B's position. So if bone A begins to face down, bone B moves away from A a certain distance. If bone A faces up, bone B moves closer to A.  Any thoughts on how to achieve this?  Thanks.

20
It seems that I need to use a Vector Rotation with the iTween Rotate To.  Is there  way I can break up the rotations of XYZ, and then input that into the Vector3 variable before the iTween begins?  What I'm trying to accomplish is to only have one of those rotations fixed at 0, and the other two flexible and pulled from variables.  I'd like to use iTween for the Ease Type.

Thanks.

21
PlayMaker Help / Help with slider float control
« on: September 23, 2016, 12:00:26 PM »
I have a slider that controls a morph target. I would like to move an object on the x-axis from 0 to 0.078 using the same slider, so when the slider is at 100 the object is at 0.078.

I used a Float Lerp, then a Float Divide by 1257, every frame for both. Then used that float to move the position of the object along the x-axis, every frame.

Any thoughts on how else to do this? Thanks.

22
PlayMaker Help / Xbox 360 controller D Pad setup?
« on: September 14, 2016, 05:47:43 PM »
I want to use 'Get key Down', but what do I assign it in the 'Key' dropdown to use the D-Pad (7th Axis)?  Thanks.

23
PlayMaker Help / Change Cameras FOV with iTween or something similar?
« on: September 09, 2016, 08:48:19 AM »
Is there a way I can change the field of view of the camera over time? Ideally I would like it to have an ease-in, similar to iTween.

Thanks.

24
PlayMaker Help / Multiple Slider problem
« on: September 02, 2016, 06:44:46 PM »
I have two horizontal sliders and each are set up to a different float variable.  They both display on screen when playing my scene, but only the top one moves. What am I missing?

Thanks

25
PlayMaker Help / How to enable/disable an action from another FSM?
« on: March 16, 2016, 10:47:32 AM »
I have a Movement FSM and on my Movement State within I have a Mouse Look Action.  On another FSM I have a button with two States. Within one of these States I'd like to enable/disable the Mouse Look Action. is it possible?

Thanks.

26
PlayMaker Help / Help with CS to add Damp to Convert Bool to Float
« on: March 11, 2016, 12:36:43 PM »
I'm not a programmer, but I need a to add a transition time when using "Convert Bool to Float".  Right now it abruptly changes my float from X to the assigned True Value. I would like it to change over time.  Could someone help with the CS portion please? Then we can share it with others.  Here is all I have:

Code: [Select]

// (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Convert)]
[Tooltip("Converts a Bool value to a Float value with Dampening.")]
public class ConvertBoolToFloatDamp : FsmStateAction
{
[RequiredField]
[UIHint(UIHint.Variable)]
[Tooltip("The Bool variable to test.")]
public FsmBool boolVariable;

[RequiredField]
[UIHint(UIHint.Variable)]
[Tooltip("The Float variable to set based on the Bool variable value.")]
public FsmFloat floatVariable;

[Tooltip("Float value if Bool variable is false.")]
public FsmFloat falseValue;

[Tooltip("Float value if Bool variable is true.")]
public FsmFloat trueValue;

[Tooltip("Repeat every frame. Useful if the Bool variable is changing.")]
public bool everyFrame;

[Tooltip("Optional: The time allowed to parameter to reach the value. Requires everyFrame Checked on")]
public FsmFloat dampTime;

public override void Reset()
{
boolVariable = null;
floatVariable = null;
falseValue = 0;
trueValue = 1;
everyFrame = false;
}

public override void OnEnter()
{
DoConvertBoolToFloat();

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

public override void OnUpdate()
{
DoConvertBoolToFloat();
}

void DoConvertBoolToFloat()
{
floatVariable.Value = boolVariable.Value ? trueValue.Value : falseValue.Value;
}

}
}


27
PlayMaker Help / When using Float Compare, I get loop count error...
« on: March 09, 2016, 01:48:28 PM »
I get this error:
"Woman : Rotation : Loop count exceeded maximum: 1000 Default is 1000. Override in Fsm Inspector."

What I'm trying to do is go to another State if my X and Z floats changes from 0 when the payer uses the input keys. 

When the character is idle, the FSM plays correctly.  As soon as I hit the movement key, the Transition moves to the other State like it should, but then crashes. What am I missing?

Thanks.



28
PlayMaker Help / Set Animator Float Damp Time does not work...[WORKS]
« on: March 03, 2016, 06:49:32 PM »
Does Damp Time allow the current value to change to the inputted value over time?

Right now my character runs at a 1. In my Set Animator Float I have 0.5 as my value, with Damp Time at a 1, and Every Frame checked. Every time I hit my button to execute the Action, it jumps abruptly to 0.5.  I would like to it be more gradual, and drop from 1 to .5 over 1 second. Any thoughts?  Thanks.

29
PlayMaker Help / How to load a game object from prefab?
« on: February 17, 2016, 03:00:18 PM »
I have two characters which are prefabs, and neither are brought into the level. I have a character controller with an FSM, and have the action to "Select Random Game Object" to randomly choose between the two.  If they're not brought into the level, how can I load the chosen one into my game?

Thanks.

30
PlayMaker Help / How to switch skyboxes?
« on: February 03, 2016, 03:05:42 PM »
I have a Set Skybox that changes my skyboxes in my Lighting Tab. That works fine, but it doesnt change the actual lighting. Someone mentioned in the Unity forums that you also need to change the Reflection Source in the Lighting Tab to Custom, and then change that via script. Can you change the Reflection Source with Playmaker? 

Or if someone else had a different solution, let me know!

Pages: 1 [2] 3 4 5