Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: colpolstudios on December 06, 2019, 02:42:48 PM

Title: Get FSM Vector3 but like Get Axis Vector
Post by: colpolstudios on December 06, 2019, 02:42:48 PM
I wish to request a new type of Get FSM Vector3.

What's needed.

Float. name = Horiz

Float. name = Vertical

I want to get the value from the left joystick interface x, y putting them into the corresponding floats named above.

I would like these elements from the normal Get Axis Vector.

Map to Plane.

Relative To.

Store Vector.

Store Magnitude.









Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: colpolstudios on December 09, 2019, 07:17:17 PM
I have been investigating and these are my thoughts.

The Get Axis Vector takes into account the user input, however, when using the new mobile input and the GET FSM Vector3. I do not get the same style of movement.

With mouse or joystick movement I can rotate the camera and move to the direction.

Try this to see what I mean:

https://simmer.io/@colpolstudios/mechanim-simple-ik-v-07 (https://simmer.io/@colpolstudios/mechanim-simple-ik-v-07)

In mouse or joystick control

you are able to rotate the camera around the player and move to the new direction.

I cannot do this with mobile contol.

I had thought this was due to other elements, but possibly this request is better suited to the help fourm? please move if thats the case.





Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: jeanfabre on December 10, 2019, 01:25:42 AM
Hi,

 I think the flaw/issue comes from somewhere else.

 all inputs ranges from -1 to 1, so GetAxisVector is going to give you just that. you can also simply get the inputs in floats and then use SetVector3Value to inject the inputs into a vector3 and you are done.

So, I would first make sure you haven't mixed up the axis, because you might want inputs mapped to x and z, instead z and y in the vector3.

Bye,

 Jean
Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: colpolstudios on December 11, 2019, 05:06:13 PM
in an effort to debug.

In the normal movement FSM, I have deactivated the Get axis vector.

We are only getting input from the get axis actions Horizontal and Vertical.

These then update the animator values we set Input X to the value Horizontal

We set Input Z to the value Vertical.

With every frame set on them all.

during the debug process I am staying in the idle state, but thats ok for now.

When I rotate around the character and press up / forward he will change direction to the new direction.

In the Mobile movement FSM, I have deactivated the get FSM float getting the magnitude, ensuring both movements are doing the same actions.

They both stay in the idle state.

Now we get the floats from the left mobile joystick interface x to the value Horizontal

y to the value Vertical.

These then update the animator values we set Input X to the value Horizontal

We set Input Z to the value Vertical.

With every frame set on them all.

The input direction compass has two separate FSM's each dealing with the specific movement types.

Normal. uses the get axis vector


Mobile. I have tried just getting the 3d position, but in this effort, I tried getting the FSM floats from the joystick interface X stored as x and Y stored as y.

Setting the vector 3 "input vector" as x to the X value and y to the Z value.

The character does change direction correctly, but when I rotate around him with the camera and try to move forward he continues to walk in the same direction!

I'm at the give up point, please help


 






Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: jeanfabre on December 12, 2019, 06:55:47 AM
Hi,

 it must be something silly, I don't understand why using getAxisVector would be any different then using GetAxis once you have them properly assigned.

Send me a repro scene, I'll have a look.

Bye,

 Jean
Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: colpolstudios on December 12, 2019, 12:11:43 PM
Hi, I zipped the project and have sent you a email with notes and a link to the project.

Thankyou so much
Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: jeanfabre on December 13, 2019, 07:40:10 AM
Hi,

 odd, did not received anything yet.

Bye,

 Jean
Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: colpolstudios on December 13, 2019, 08:16:46 AM
hmme strange.

Ive just sent pm.

1.15 pm GMT
Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: jeanfabre on December 17, 2019, 12:54:31 AM
Hi,

something is odd, to which email you are sending exactly, I did not received anything at all from you. pm me with more details, thanks.

Bye,

 Jean
Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: colpolstudios on December 17, 2019, 05:47:02 PM
pm sent on the 13th December 2019

06:12.59 Am

I've the copy still in my sent box.

Title of pm:

help with get axis vector and get FSM vector 3
Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: jeanfabre on December 18, 2019, 12:55:27 AM
Hi,

my bad, total brain failure and blindness... I was waiting something in my mailbox. I got this, will check in the coming days.

Bye,

 Jean

 
Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: colpolstudios on December 31, 2019, 11:40:39 AM
Hi Jean,

any update on this ?
Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: jeanfabre on January 07, 2020, 05:20:10 AM
Hi,

 ok, so you have confused many concepts here.

first, in non mobile mode, you use the mouse to rotate the camera, in mobile you don't have that, so your camera is never correcting the direction.

also, in your InputDirectionCompass, why are you not also making the CameraAutoLookAt the target of your look at for mobile? it tries to rotate another object, that doesn't make sense.

on mobile, you'll need to have a dummy object attached to the Model placeHolder, which represent the camera position. then have your camera position to move towards that dummy, and you are done with it.

If I attach the camera to the model placeholder, all is good, but to abrupt, do as I mentionned above to put some smoothing.

another way would be to use SmoothLookAtDirection for the camera on mobile. Get the direction of your player using TransformDirection, that works as well. you might need some fiddling on that to get it right.

I got it to work: check it here: https://imgur.com/3Rlci7q


Bye,

Jean
Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: colpolstudios on January 08, 2020, 03:26:47 PM
sorry for the late reply.

In mobile, the right on-screen control is used to move the camera.

Did you try using the right stick to move the camera and then change direction of the character?

Both FSM's of the InputDirectionCompass smoothlookatdirection are now set to use owner.

If I choose mouse control, I can rotate around the character so that the camera is now directly in front of the character. Pressing the forward /up arrow key the character will turn around and walk in the new direction.

If I choose mobile control and use the right on-screen joystick I rotate around so that I am now directly in front of the character. Using the left joystick control up/forward direction. The character does not change direction.

Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: colpolstudios on January 13, 2020, 04:54:49 AM
Firstly I'm, not a coder, but looking inside the action Gst axis vector it seems that if we could get the input from the joystick interface we could use these parameters instead of the unity inputs?

Maybe you got a chance to take another look, Jean?
Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: jeanfabre on January 14, 2020, 02:34:32 AM
Hi,

To answer your question: I made a custom action that accepts regular float instead of unity input: GetCustomAxisVector

Hopefully this is what you need, but I doubt it. Your problem is else where from how you created your scene, your camera controls is different, you need to fix that, the joystick input is fine and all actions are sound here.

 Do you understand what I did and why I did it? yes, mobile is different, but that's not the point of your struggle technically, what's happening is that your camera control isn't suitable as is to work for both inputs. the core problem is that your camera is using the mouse to rotate.

Bye,

 Jean
Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: colpolstudios on January 14, 2020, 04:56:29 AM
The custom action resolved the issue.

Regarding the core problem, when using mouse control only the input from the mouse is used to rotate the camera.

When using mobile control only the input from the UI right joystick is used to rotate the camera.

When using a PlayStation controller only the input from the right control stick is used to rotate the camera.

Everything is working now with the help of your custom action.

many thanks
Title: Re: Get FSM Vector3 but like Get Axis Vector
Post by: jeanfabre on January 14, 2020, 11:19:52 AM
Hi,

 Cool :) I am glad you can progress now.

Bye,

 Jean