playMaker

Author Topic: Get FSM Vector3 but like Get Axis Vector  (Read 1195 times)

colpolstudios

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Get FSM Vector3 but like Get Axis Vector
« on: December 06, 2019, 12: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.










colpolstudios

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #1 on: December 09, 2019, 05: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

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.






jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15219
  • Official Playmaker Support
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #2 on: December 09, 2019, 11:25:42 PM »
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

colpolstudios

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #3 on: December 11, 2019, 03: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


 







jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15219
  • Official Playmaker Support
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #4 on: December 12, 2019, 04: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

colpolstudios

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #5 on: December 12, 2019, 10:11:43 AM »
Hi, I zipped the project and have sent you a email with notes and a link to the project.

Thankyou so much

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15219
  • Official Playmaker Support
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #6 on: December 13, 2019, 05:40:10 AM »
Hi,

 odd, did not received anything yet.

Bye,

 Jean

colpolstudios

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #7 on: December 13, 2019, 06:16:46 AM »
hmme strange.

Ive just sent pm.

1.15 pm GMT

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15219
  • Official Playmaker Support
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #8 on: December 16, 2019, 10:54:31 PM »
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

colpolstudios

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #9 on: December 17, 2019, 03: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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15219
  • Official Playmaker Support
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #10 on: December 17, 2019, 10:55:27 PM »
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

 

colpolstudios

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #11 on: December 31, 2019, 09:40:39 AM »
Hi Jean,

any update on this ?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15219
  • Official Playmaker Support
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #12 on: January 07, 2020, 03: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

colpolstudios

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #13 on: January 08, 2020, 01: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.


colpolstudios

  • Full Member
  • ***
  • Posts: 238
    • View Profile
Re: Get FSM Vector3 but like Get Axis Vector
« Reply #14 on: January 13, 2020, 02: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?