playMaker

Author Topic: Cinemachine AxisState set properties - value and max speed[SOLVED]  (Read 13242 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Cinemachine AxisState set properties - value and max speed[SOLVED]
« on: September 14, 2019, 09:33:20 AM »
When characters go into menus, the right thumbstick should no longer rotate the cinemachine camera. I want to therefore set the Max Speed for the Y and X AxisStates, to 0, then back to their normal speed upon menu exit.

I also want to set the Value for the X and Y axes as well to prevent whipping during transitions between cameras. (get current camera's y value, set target camera's y value to that, do transition.) currently it doesn't keep all updated in their rotation, so going into first person mode, THAT camera might be facing back the other way from the direction of the 3rd person camera, causing disorientation upon switching.

But I cannot find in the playmaker actions, or in Set Property, where to set the values or the max speed for the axis states. There's like a billion euler angles and local rotation and rotation variables, but none of them seem to correspond to what I need.

The actions need to work in FreeLook AND Virtual Camera components. In the Cinemachine FreeLook script, I've found where the variables are but don't know how to access them at runtime using playmaker:

[AxisStateProperty]
        public AxisState m_YAxis = new AxisState(0, 1, false, true, 2f, 0.2f, 0.1f, "Mouse Y", false);.
« Last Edit: May 26, 2020, 02:38:27 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Cinemachine AxisState set properties - value and max speed
« Reply #1 on: September 17, 2019, 04:36:21 AM »
Hi,

 That's not a nice option, let me add a feature on my input proxy to account for that.

I'll publish tomorow

Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Cinemachine AxisState set properties - value and max speed
« Reply #2 on: September 20, 2019, 03:00:11 AM »
Hi,


ok, new version up.

use the CinemachineCoreGetInputTouchAxis component, there is a Inputenable property on this.

 use then the action EnableCoreInput on that component to turn on and off inputs.

Bye,

 Jean

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Re: Cinemachine AxisState set properties - value and max speed
« Reply #3 on: September 20, 2019, 06:29:30 AM »
thanks! where is this proxy located?

also, does this cover the second part, where I need to get and set the Y value of the cameras before transitions to prevent whipping/facing the wrong direction afterward?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Cinemachine AxisState set properties - value and max speed
« Reply #4 on: September 20, 2019, 06:58:37 AM »
Hi,

just search for CinemachineCoreGetInputTouchAxis component in your assets.

 I haven't done the offset yet, will do that this afternoon.

Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Cinemachine AxisState set properties - value and max speed
« Reply #5 on: September 20, 2019, 08:19:36 AM »
hi,

 done, new action CameraOffsetGetProperties and CameraOffsetSetProperties

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Re: Cinemachine AxisState set properties - value and max speed
« Reply #6 on: October 28, 2019, 08:50:24 PM »
cool. I'd love to check this out, but where is the proxy located? I mean, where do I download these updated files from? These updated files are not present in my project already.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Cinemachine AxisState set properties - value and max speed
« Reply #7 on: October 29, 2019, 02:55:59 AM »
Hi,

 you need to update the package from the Ecosystem browser. the new actions are in there. so search for cinemachine and download the package and install it.

Bye,

 Jean

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Re: Cinemachine AxisState set properties - value and max speed
« Reply #8 on: October 31, 2019, 09:44:03 PM »
oh, great! These are great, but I haven't quite solved my issue. I need to copy the Y and X axes of the free look cameras, before transitioning to others. I actually solved it MOSTLY by using the "inherit position" tick box I never saw before, but the problem remains when transferring away from the 1st person camera (virtual camera) to the 3rd person cameras (free look cameras). when I transition from 1st to 3rd, it seems it TRIES to inherit the position but can't find the Y and X axis settings from the 1st person virtual camera, so it defaults to Y=1 and X=90

I need to somehow get the 1st person Virtual Camera's Aim > POV > Vertical Axis > Value and Horizontal Axis > Value float settings, convert those to correct Y and Z rotation settings, and paste those into the "inherited position" of the 3rd person camera in its Y axis and X axis. I've attached a picture of what I need to do.

I need to be able to get and set these float properties but cannot figure out how. I can do float remap and convert/normalize them, if I can just figure out how to retrieve and set them.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Cinemachine AxisState set properties - value and max speed
« Reply #9 on: November 01, 2019, 03:17:46 AM »
Hi,

 It seems to me that you are working against Cinemachine workflow.

 each different point of view needs a virtual camera and then you can use a blending component to choose which camera to use, and animating/transitioning between them becomes a matter of adjusting blending weights.

Can you confirm this is what you are trying to achieve?

I would first ask on Cinemachine forum what you are trying to achieve and how it can be done with cinemachine as is, and if indeed you need programming, then let's see what they come up with and I'll port that to PlayMaker.


Bye,

 Jean

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Re: Cinemachine AxisState set properties - value and max speed
« Reply #10 on: March 18, 2020, 05:12:17 PM »
I've written to the Cinemachine people but they have not written back.

I really just need to know how to set the property shown in the picture below. As long as I can get and set that property, I can make all this work. Currently going from 1st person to 3rd person resets the Axis Control > Y Axis > Value to 0, and there are so many values in the Cinemachine script I cannot locate it with Get/Set Property.

I am not blending between the cameras but just switching instantly. All I need is to know how to get and set these values. I've tried dozens of variables in Get/Set Property, but NONE seem to affect this value.

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Re: Cinemachine AxisState set properties - value and max speed
« Reply #11 on: March 24, 2020, 01:35:56 AM »
A Unity person responded and said the values I need are:

FreeLook.m_YAxis.Value
and
vcam.GetCinemachineComponent<CinemachinePOV>().m_HorizontalAxis.Value

But I cannot find these in either the free look camera component's Get Properties or the virtual camera's. How can I get and set these values? That's all I need to be able to move forward. I feel like I've searched for m_Yaxis, etc. in these properties menus to no avail.

« Last Edit: March 24, 2020, 01:39:16 AM by westingtyler »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Cinemachine AxisState set properties - value and max speed
« Reply #12 on: March 25, 2020, 05:10:13 AM »
Hi,

 yes, cinemachine api is very convoluted, and reflection never works with this kind of api, I'll make some custom actions for this.

Do you need it for the freelook or for CinemachinePOV or both? I need to exact component you use because it will be dedicated for each...

Bye,

 Jean

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Re: Cinemachine AxisState set properties - value and max speed
« Reply #13 on: March 27, 2020, 08:20:23 AM »
wow thank you. I need it for both. Cinemachine Virtual Camera and Cinemachine Free Look Camera.

There is also a new in beta Third Person Follow camera according to the Cinemachine devs. It would be cool to have an action for that someday when it's released, but for now I'm not switching over until that stuff is out of beta.

I am very excited! Thank you!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Cinemachine AxisState set properties - value and max speed
« Reply #14 on: March 30, 2020, 02:22:40 AM »
Hi,

 ok, new version up on the asset store, featuring access to the Input Value and AXis Value.

Cool the new features, we'll see how it gets adopted.

Bye,

 Jean