Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: westingtyler on September 14, 2019, 09:33:20 AM

Title: Cinemachine AxisState set properties - value and max speed[SOLVED]
Post by: westingtyler 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);.
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre 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
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre 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
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: westingtyler 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?
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre 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
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre on September 20, 2019, 08:19:36 AM
hi,

 done, new action CameraOffsetGetProperties and CameraOffsetSetProperties
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: westingtyler 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.
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre 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
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: westingtyler 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.
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre 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
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: westingtyler 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.
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: westingtyler 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.

Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre 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
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: westingtyler 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!
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre 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
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: westingtyler on May 07, 2020, 05:15:59 PM
Hello. this sounds great. Can you tell me which actions I need to use to use these new features?
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre on May 13, 2020, 01:57:36 AM
Hi,

action like FreeLookCameraGetXaxisSettings for example.

Bye

 Jean
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: westingtyler on May 14, 2020, 01:31:45 AM
I still can't seem to figure out where to retrieve the cameras' rotation values. Free Look Camera Get YAxis Settings doesn't seem to include the current rotation angle float. That's the variable I need, and it's like a needle in a haystack and I cannot seem to find it still.

I've attached an image showing the available Free Look actions, but the only ones of use seem to be Get Rig Settings and Get xAxis Setttings, neither of which exposes the rotation float. Am I missing something simple?
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre on May 15, 2020, 02:11:34 AM
hi,

 can you make a screenshot of the freelook inspector and circle out the property you want to access? I am not sure I follow what you are missing.

Bye,

 Jean

Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: westingtyler on May 15, 2020, 03:49:27 AM
Sure, no prob. I actually posted this earlier in the thread. I've attached it again. Is that what you meant I needed to screengrab?

I think I had them pinpointed in the script to this: [AxisStateProperty]
        public AxisState m_YAxis = new AxisState(0, 1, false, true, 2f, 0.2f, 0.1f, "Mouse Y", false);.

I need to GET the property at the left side of this screen grab, remap the float into a useable range, and SET it onto the right side, and vice versa.
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre on May 18, 2020, 03:06:05 AM
Hi,

 it should be there:

(https://i.imgur.com/GQwIaVl.png)

Bye,

 Jean
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: westingtyler on May 20, 2020, 06:28:26 AM
thanks! my version doesn't have that.

you said "new version up on the asset store", but I made the mistake of buying it NOT from the asset store, so I have to use the download link in my email from the purchase. if I could switch to the asset store version that would be ideal, but if I can't, how do I get this action?
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre on May 20, 2020, 10:12:06 AM
Hi,

:) I see, I meant new version on the Ecosystem.... sorry!

Bye,

 Jean
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: westingtyler on May 21, 2020, 10:35:17 AM
cool this is great. So I am able to get/set the Free Look Over the Shoulder camera's X and Y values, but the first person camera is a Virtual Camera.

I can't find another action called "Virtual Camera Get/Set X/Yaxis Settings" to use it with to transition between 1st and OTS cameras.

Is the Free Look Camera Get/Set X/Y Axis action supposed to work with both the Virtual Camera component and the Free Look camera component?
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre on May 22, 2020, 01:55:39 AM
Hi,

virtual camera do not have input axis, else can you make a screenshot of the component? if it's there I can find a way to get to it.

get/set axis can only work on component that themselves feature this axis system.

Bye,

 Jean
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: westingtyler on May 22, 2020, 07:15:24 AM
okay. the one on the left, with the red circle around it is the value I need to get somehow. You've provided a great way to get/set the value on the right side image, but I still need a way to get the circled value on the left side image.
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre on May 22, 2020, 08:12:40 AM
Hi,

 what is this First person virtual camera? I don't have that. Can you make a screenshot where I can see the name of the component?

Bye,

 Jean
Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: westingtyler on May 23, 2020, 06:30:22 PM
okay. i think it's a virtual camera component, and I just call it "first-person" because I use it for that.

Title: Re: Cinemachine AxisState set properties - value and max speed
Post by: jeanfabre on May 26, 2020, 02:38:08 AM
Hi,

 ok, done, new actions available to access these axis settings:

VirtualCameraAimPovSetYaxisSettings
VirtualCameraAimPovGetYaxisSettings
VirtualCameraAimPovSetXaxisSettings
VirtualCameraAimPovGetXaxisSettings

Bye,

 Jean
Title: Re: Cinemachine AxisState set properties - value and max speed[SOLVED]
Post by: westingtyler on May 29, 2020, 04:43:53 PM
Hello. Using these actions i am able to get the vertical rotation of the 1st person Virtual Camera and successfully remap the float to 0-1 for use with the OTS Free Look Camera's Axis Control Y Axis Value

But i cannot seem to SET the final value on the Free Look Camera.

Does the "Free Look Camera Set Yaxis Settings" action's Value float set the FL cinemachine component correctly? or do I need a "Free Look Camera Aim POV Set X/Y Axis Settings" action?

No matter what, the character camera still faces the ground (Y axis value=1) when exiting 1st person mode, instead of facing the direction the first-person camera was facing.

In the attached image you can see I have the right value i need, but it won't 'set' to the Free Look camera, which always defaults to 1.
Title: Re: Cinemachine AxisState set properties - value and max speed[SOLVED]
Post by: jeanfabre on June 01, 2020, 02:39:49 AM
Hi,

 are you sure it's not because the value is controlled by Unity inputs?

can you change it manually in the inspector?

Bye,

 Jean
Title: Re: Cinemachine AxisState set properties - value and max speed[SOLVED]
Post by: westingtyler on June 07, 2020, 08:02:58 PM
yes, I can change the visible angle by going over to the inspector and changing the value. it changes, and going back to the game window does not alter it against my wishes.

here is a vid of the problem. all transitions keep the camera's view angle. but going from first person to over the shoulder resets the Y value on the OTS view, and makes the character look down. all other transitions are fine. what is the best way to fix this, if not by setting the Y value manually upon transitioning from first-person to over the shoulder? I'm trying to do that, but it's not "sticking", and not setting the value, as discussed previously.

Title: Re: Cinemachine AxisState set properties - value and max speed[SOLVED]
Post by: jeanfabre on June 10, 2020, 01:31:18 AM
Hi,

 if you can change manually at runtime that value, you can change it with playmaker as well, can you confirm this?

I would ask on Cinemachine for the best way to set it up. Cinemachine can be very capricious and tricky to setup right.

Bye,

 Jean
Title: Re: Cinemachine AxisState set properties - value and max speed[SOLVED]
Post by: westingtyler on June 10, 2020, 05:11:12 AM
okay, I confirmed the action works correctly. I made an fsm with a GET KEY DOWN, and set the Y value after that, and it works. The problem seems to be, whenever I switch to a different CM camera using the send animator trigger for it, I then must wait like 0.2 seconds BEFORE using the Free Look Camera Set Y Axis Settings or it "won't have time to adjust" which is weird since the transitions are all simple Cuts.

That's true this was a workaround to deal with the fact the transitions didn't keep the angle to begin with, so I will ask the cinemachine people why the Y was getting reset to 1 upon each transition from the Virtual Camera to the Free Look Camera, as that SHOULD already work by default. Thanks!