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

Pages: [1] 2 3 ... 8
1
how do I add a speed float to a player controller based on controller's Y rotation?

Basically, the goal is: the player is on a bike. and if you press A, it starts you moving using a speed float, in the direction the player controller game object is facing. You can use a joystick to change the player's facing direction (Y rotation), and you always move forward according to the direction of the bike.

the character controller will move along the X and Z axes at the speed specified by the speed float, using a controller move action, but I'm not sure how to add the speed to the move vector based on the Y direction of the player. (to deal with diagonal movement in the world.)

How is this achieved? I originally used a rigidbody add force thing, but I could not figure out how to make gravity work while also preventing it from ramming into inclines and hills it met. So I'm using a player controller because it knows how to fall and go up and down hills normally.

2
Hello. I have two issues. one with moving the map in the map view, and one with rotating the camera around the player in normal gameplay. they work fine. BUT, these things are slooow in play mode, and super fast in builds. i am wondering if the float operators used need to use delta time instead of "every frame" or something?

in the map view, you press the left stick, and the camera moves in front of the textured map plane. here's how it's set up:
get axis vector of the Left Gamepad Stick.
get the current camera position's x and y floats.
do a float operator to add the input axis vector to the position floats.
set the new camera position.
all are set to 'every frame.'
it works normally except for the speed changing wildly. in builds the camera moves around the map quickly, but in play mode it moves slowly. i am worried the default map move speed will be different for players depending on their computer's specs. i seem to remember something about using 'delta time' to ensure the view changes in a speed independent of frame rate, but I'm not sure how that would apply here. in play mode, everything else works normally, but at a lower frame rate than builds, but there's no noticeable input differences except for these.


The second problem is the same, except it's with regard to using the gamepad stick to rotate the camera centered around the player model. in play mode, it rotates slowly, and in builds, it rotates wildly fast.

for camera rotation around the player, it's this:
get axis vector of right stick.
vectory3 add xyz, to add the axis input to the current camera rotation.
wait till next frame, repeat.

in both of these cases I can change the input axis multiplier floats to "fix" this, but this makes it hard to figure out what the default speeds should be since it varies.

what can I do to make these changes to position and rotation, happen at a speed independent of player's computer speeds (and to not need two different multiplier float settings to toggle depending on if I'm testing in play mode or in a build)?

for all I know for a player with a fast computer the camera might rotate so fast the game is unplayable, and for all I know on someone's computer that's slow, it might rotate so slow it's unplayable, so I am worried about this.

3
Action Requests / Particle System Set Force Over Lifetime?
« on: March 26, 2019, 10:11:31 AM »
Hello. The rain system is attached to the player. When the player gets into and drives a car, I want to change the direction of the particles to move sideways from in front of the player to hid the windshield, like how rain looks while driving. Normally the rain falls straight down but moves more sideways in a car.

But I can't find an action to set the Force Over Lifetime of a particle system. if this does not exist, it would be very useful to have. It seems it needs an XYZ vector3, and being able to do it each frame would be great so I could slowly change the particle direction as the car speed increases. Is it possible?

4
I need to round a float up to the nearest integer, and I also need to separately store the float's remainder to do operations on it. I'm not sure which actions are best for this kind of thing. "Float Round to Nearest" won't do it, as I need to say "is the float an integer? if not, round it up to the next integer." What's the best way to tackle this?

5
I wanted an array of audio clips in an fsm to select from by name. so i made an array variable. the list for its types did not contain an audio clip option, so I changed it to object, unityengine, audio clip. upon doing this. the array changed from being an array, to just being an audio clip in the Variables Tab under its Type button on the right side of the menu. the array below seems to act normal, but it's now listed as an Audio Clip instead of as an array.

Area: Editor
Frequency: Always

Unity Info:
Unity Version: 2018.3.0f2
Playmaker Version: 1.9.0.f5
BuildTarget: StandaloneWindows64

System Info:
OS: Windows 10  (10.0.0) 64bit
Processor: AMD FX(tm)-4130 Quad-Core Processor
System Memory: 32749
Graphics Device: NVIDIA GeForce GTX 970

6
Hello! I need to create a state that monitors the rotation of an object and sends different events depending on the rotation.

So I need an action that will check the rotation float and send an event if it's between number A and number B. The best way CURRENTLY that I can think of to do this with, is to do have two subsequent states with float compares. "is float above low number? if yes, is float below high number?" needless to say this means that for every angle range, I would need double the states. so if I have 10 options around a circle, I would need 20 float compare states to cover everything, instead of just having 10 "Float Range Test" actions in a single state to send their event if true.

This perhaps could be done with a Float Compare with a tolerance set at the exact center of a range, but finding this exact number for all ranges would seem tedious, since wouldn't it be easier to just set the bottom number and the top number of the range.

7
I want my player controller to climb walls, but if I do player controller simple move along that vertical axis, the player just ignores that due to its gravity I think. As shown in the screenshots, I get an error when I use set property to disable the character controller's attached rigidbody. This inability to edit the character controller script to turn off gravity means I can't get the character to jump, glide, slide down hills correctly, or climb, and it's driving me nuts. Why did Unity make the script un-editable? someone said there's a standard assets "3d person platformer controller" but I can't find that in the standard assets anywhere, either.

The screenshots show tests AFTER removing the attached rigidbody from the player game object, but the error was the same with or without it. and the character drops if I manually raise it up and release it, implying it already has a rigidbody attached that I can't see.

Also, to confirm, is it true I should NEVER also attach a rigidbody to a game object with a player controller, since the player controller apparently has a rigidbody embedded in it, as this would mean there are two rigidbodies on the same game object? But it seems I also need to add a rigidbody because I try to do things to the character controller like Add Force, playmaker tells me the game object needs a rigidbody?

Here's the error:

NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMaker.ReflectionUtils.SetMemberValue (System.Reflection.MemberInfo[] memberInfo, System.Object target, System.Object value) (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ReflectionUtils.cs:351)
HutongGames.PlayMaker.FsmProperty.SetValue () (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmProperty.cs:309)
HutongGames.PlayMaker.Actions.SetProperty.OnEnter () (at Assets/PlayMaker/Actions/SetProperty.cs:26)
HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex) (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState.OnEnter () (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2767)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState) (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2714)
HutongGames.PlayMaker.Fsm.UpdateStateChanges () (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2642)
HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state) (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2783)
HutongGames.PlayMaker.Fsm.Update () (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1994)
PlayMakerFSM.Update () (at C:/Users/Alex/Documents/Unity/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:579)

Unity Version: 2018.3.0f2
Playmaker Version: 1.9.0.f5
BuildTarget: StandaloneWindows64

System Info:
OS: Windows 10  (10.0.0) 64bit
Processor: AMD FX(tm)-4130 Quad-Core Processor
System Memory: 32749
Graphics Device: NVIDIA GeForce GTX 970

as always, the bug reporter says unity 2017.1 broke it and to copy and paste everything, so this is what I needed to do.

8
My current method for choosing footstep sounds to play, is getting the tag of the object your foot's trigger entered. But this means I need tags for Dirt, Sand, Concrete, etc., etc. which is really cumbersome. It also won't work correctly if a place the player steps on has multiple textures on it, like a path through the woods that has dirt, stone, and mud on the same game object but in different spots.

Another method is to have a billion empty game objects named different things, placed throughout the map, and check distance among all of them with each step to determine which is closest to the player. But that seems costly.

Is there some way to check the polygon face directly beneath the player's foot, that it collides with, and get the material index of THAT face? If so, this would save a lot of hassles getting the correct footsteps to play automatically based on which textures I use in the game.

9
Playmaker Help / Way to Manage Animations More Simply?
« on: November 22, 2018, 05:23:34 AM »
I have a character animator component that is set up on the player, and it has like 130 animations in its Animator graph with a web of links. Do I really need to set up 130 animator triggers, one for each transition, to send the character to that animation upon demand?

It would be best if there was some way to just do an action that said "Send Animator Transition"
then you specify the two string names of the animations that are being transitioned, which would never have duplicates in the graph.

So it would look like "
Send Animator Transition
Animation Name A (string): Standing Pointing
Animation Name B (string): Standing Thumbs Up
Send Event X if Transition Does Not Exist.
so it would find the transition called Standing Pointing > Standing Thumbs Up, and send it. Simple.

Is there a way to do this, or do i really need to add 130 (and more to come) animator triggers, and manually assign them to certain transitions, just to get this effect?

I also looked at the Play Animation action, but seems I need to add all 130 animations to a list for it to call from, which seems redundant since these animations are already in the character's Animator graph.

Unless I can populate this animation list by checking the character's Animator Graph at runtime, and unless I can copy this whole component onto other characters at runtime (or make them all draw from the same list), it makes things more convoluted than would be ideal.


The truly ideal way to do this, would be if there was an Animation variable in Playmaker, so I could make a Hash Table of Animations for all characters to draw from, then when I say "Play Animation" I specify the name of the animation, and it finds that key in the Animation hash table. The Play Animation/Animation list thing seems to do something similar, but do I have to add this list to every character model before runtime? Do I need to have an Animator component AND a list, all with all animations, transitions, and triggers, on every character, just so they all can do the same things? It seems there could be a more streamlined way.

So in conclusion,

A single hash table of animations that ALL characters could draw from with the use of a Play Animation/Get Animation Variable from Hash Table action,

and/or an action to populate a character's Animation List from its Animator graph at runtime,
and/or a Play Animator Transition by Name action in Playmaker, would make animation way easier.

Is there something I'm missing that makes this easy?

PS. It would also be cool if we could get a string array list of all the animation names in the Animation List (I'm making an in-game cut scene editor, and players need to know the exact name of the animations because some have underscores and some don't.)

10
Action Requests / Hasht Table Get By Index (Not Key)
« on: November 19, 2018, 05:19:42 PM »
Hash Table Get By Index (Not Key)

Has Table Get only allows by Key it seems, but I want to get them by a specific Int Index.

11
Action Requests / Get FSM Array Variable by String Name (Not Just by Index)
« on: November 13, 2018, 07:59:40 PM »
Get FSM Array Variable by String Name (Not Just by Index)

This would save us having to copy over the entire array to a different fsm, just to do an Array Contains search on it.

EDIT: this is even harder than I thought. It seems we can only use Array Contains by index or exact type match (game object array contains this game object?) rather than saying "game object array contains game object named X?"

We need to be able to check ANY array type for an entry with a certain NAME, whether it's an array of prefabs, textures, strings, etc. Please help.

12
Action Requests / String to Float with Case for if Invalid
« on: November 13, 2018, 03:10:15 PM »
My game keeps hanging when players put in a time string, then the String to Float can't handle it. Would be great if there was a case in this action for "do if not a valid float/or is empty".

13
Action Requests / Get Float Right
« on: November 13, 2018, 11:48:38 AM »
Hello. I need an action that gets the rightmost two places of a float variable. currently I have to convert the float to a string, get string right 2, then convert that to a float again.

so if the input float is 632, the result of this action would be 32.

also it would be great to have a similar one for get float left. thanks!

14
Feature Requests / Hide/Reduce Size of the FSM "Inspector" Window?
« on: November 05, 2018, 08:28:04 PM »
Hello. It would be nice to have a little icon at the top of an FSM in the editor, and if you click it, it totally hides the right-side "inspector" window - the part of the editor with tabs like FSM, STATE, EVENTS, VARIABLES.

It would also be nice to be able to reduce its size FURTHER, as it has a "minimum" size that still takes up a lot of space, especially on my computer that has text size at 150%.

Reducing or hiding the window would make it easier to view my FSM and also to perform some specific actions (I'm currently copying a state from one FSM into several, meaning I don't need this window at all, just to see the main editor itself.)

15
Action Requests / Check if String is a Valid Hex Code (for Color Variables)
« on: November 04, 2018, 11:53:58 PM »
players can type a string, then the game sets the ambient color value to that. But what if they type a string that is too long, or isn't a valid color, or has weird symbols? i need an action that checks the string, then says yes or no, so I can send an event that provides a case to deal with that.

Pages: [1] 2 3 ... 8