Playmaker Forum

Playmaker News => General Discussion => Topic started by: mrminico on July 29, 2018, 12:17:06 AM

Title: Rewired/Cinemachine Actions discussion
Post by: mrminico on July 29, 2018, 12:17:06 AM
Hello everyone!

lately, I've been using Cinemachine and ReWired actions for a multiplayer game I'm working on. I've hit an unfortunate dead end while using both of these plugins and cannot control Cinemachine's free look cam using ReWired axis. I also cannot get the proper usage of Get Axis Vector for movement relative to camera position.

Now as an alternative I tried using ReWired Unity Input Override addon and it actually worked for the Get axis vector action (And all other PM Input actions). Although I got the Get Axis Vector action to work I faced the problem of not being able to assign multiple controllers. There was no way for me to replicate the get axis vector action using ReWired actions so I gave up on that.

As for Cinemachine, the override addon had no effect. I read on ReWired docs that The input script must make all calls by using the shortened form of "Input.GetAxis" instead of the fully-qualified form "UnityEngine.Input.GetAxis". Scripts that use fully-qualified calls cannot be rerouted to Rewired because the compiler is explicitly instructed which Input class to use.

Now I tried looking at Cinemachine's free look cam code just to see if it was using Input.GetAxis and it wasn't. It assigned the Axis using different input code to access Unity's Input system.

Now i'm no programmer so I wouldn't know how to make custom actions for these two plugins. I do hope that Guavaman sees this and make a Get Axis Vector action
 and Cinemachine Set Freelook cam Axis action that's compatible with ReWired. Those actions are literally the bread and butter to any 3rd person game and non coders would greatly benefit from it for sure.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on July 30, 2018, 01:00:58 AM
I won't be making an Action to replicate what GetAxisVector does. Rewired provides input. It does not provide in interpretation/use of that input. IE: transforming input into other spaces, moving objects, etc. That is beyond the scope of the system. It would quickly snowball into a gigantic monster with an infinite number of expected actions/methods for every different use case everyone has.

The proper way to do something like this is to separate the "getting the input value" and "transforming the input value" into two separate actions. Then you simply get the input, store it in a variable, then transform the input and apply it to whatever you want to apply it to.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: mrminico on July 30, 2018, 01:20:15 AM
I won't be making an Action to replicate what GetAxisVector does. Rewired provides input. It does not provide in interpretation/use of that input. IE: transforming input into other spaces, moving objects, etc. That is beyond the scope of the system. It would quickly snowball into a gigantic monster with an infinite number of expected actions/methods for every different use case everyone has.

The proper way to do something like this is to separate the "getting the input value" and "transforming the input value" into two separate actions. Then you simply get the input, store it in a variable, then transform the input and apply it to whatever you want to apply it to.

Thanks Guavaman,

How about Cinemachine Free look Cam? Any tips on how I could override Input controllers there with the current actions provided or would that require some custom code?
Title: Re: Rewired/Cinemachine Actions discussion
Post by: jeanfabre on July 30, 2018, 02:58:54 AM
Hi,

 to take over inputs in Cinemachine, you need to explictly declare you'll take over by script:

https://forum.unity.com/threads/overriding-freecamera-cinemachine-inputs-or-freecamera-axis-inversion.484819/

https://forum.unity.com/threads/making-cinemachine-play-nice-with-rewired.517547/

Bye,

 Jean
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on July 30, 2018, 09:31:38 AM
I also cannot get the proper usage of Get Axis Vector for movement relative to camera position.

This is a simple and very common transformation operation:

Code: [Select]
// Transform from camera space to world space
Vector3 worldSpaceMoveVector = Camera.main.transform.TransformDirection(inputVector);

// Apply deltaTime and speed
worldSpaceMoveVector *= Time.deltaTime * speed;

// Move the object in world space
target.Translate(worldSpaceMoveVector, Space.World);

You should be able to easily do the same using PlayMaker actions.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on July 30, 2018, 09:59:56 AM
I won't be making an Action to replicate what GetAxisVector does. Rewired provides input. It does not provide in interpretation/use of that input. IE: transforming input into other spaces, moving objects, etc. That is beyond the scope of the system. It would quickly snowball into a gigantic monster with an infinite number of expected actions/methods for every different use case everyone has.

The proper way to do something like this is to separate the "getting the input value" and "transforming the input value" into two separate actions. Then you simply get the input, store it in a variable, then transform the input and apply it to whatever you want to apply it to.

Thanks Guavaman,

How about Cinemachine Free look Cam? Any tips on how I could override Input controllers there with the current actions provided or would that require some custom code?

Jean's post shows what you need. Here's a more simplified version:

(code removed)
Title: Re: Rewired/Cinemachine Actions discussion
Post by: mrminico on July 30, 2018, 03:34:40 PM
Thank you so much you guys are literally the best. I'll save this cinemachine script forever! having control of the free look cam was the deciding factor of weither i'll be using ReWired or unity's dreadful input system.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on July 30, 2018, 04:30:28 PM
Thank you so much you guys are literally the best. I'll save this cinemachine script forever! having control of the free look cam was the deciding factor of weither i'll be using ReWired or unity's dreadful input system.

I posted two versions (somewhat modified) here:
https://forum.unity.com/threads/making-cinemachine-play-nice-with-rewired.517547/#post-3580596

One is a MonoBehaviour version and the other is a static version. Both can have their player ids changed, just with a different method. There will also links to download these in the documentation starting with the next version.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on July 30, 2018, 08:40:19 PM
I updated the script with a new unified version:
https://forum.unity.com/threads/making-cinemachine-play-nice-with-rewired.517547/#post-3580596

It also works better with joystick/keyboard input.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: mrminico on July 31, 2018, 02:27:28 PM
I updated the script with a new unified version:
https://forum.unity.com/threads/making-cinemachine-play-nice-with-rewired.517547/#post-3580596

It also works better with joystick/keyboard input.


Thanks! This is awesome for ReWired! Can't wait to see it up officially on the site's documentation. I'm super excited about this. As soon as I get home I'll copy the code from the forums and give it a spin.

Also, what would you recommend not to do when using ReWired that can impact performance. I know every plugin works Unity differently and I always like to ask the developers directly since they know best.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on July 31, 2018, 03:35:06 PM
I updated the script with a new unified version:
https://forum.unity.com/threads/making-cinemachine-play-nice-with-rewired.517547/#post-3580596

It also works better with joystick/keyboard input.


Thanks! This is awesome for ReWired! Can't wait to see it up officially on the site's documentation. I'm super excited about this. As soon as I get home I'll copy the code from the forums and give it a spin.

Also, what would you recommend not to do when using ReWired that can impact performance. I know every plugin works Unity differently and I always like to ask the developers directly since they know best.

I just changed it. Now it's included as a menu install just like every other integration.

Optimization:
http://guavaman.com/projects/rewired/docs/HowTos.html#optimization
Title: Re: Rewired/Cinemachine Actions discussion
Post by: mrminico on August 03, 2018, 02:48:43 PM
I updated the script with a new unified version:
https://forum.unity.com/threads/making-cinemachine-play-nice-with-rewired.517547/#post-3580596

It also works better with joystick/keyboard input.


Thanks! This is awesome for ReWired! Can't wait to see it up officially on the site's documentation. I'm super excited about this. As soon as I get home I'll copy the code from the forums and give it a spin.

Also, what would you recommend not to do when using ReWired that can impact performance. I know every plugin works Unity differently and I always like to ask the developers directly since they know best.

I just changed it. Now it's included as a menu install just like every other integration.

Optimization:
http://guavaman.com/projects/rewired/docs/HowTos.html#optimization

Hey Guavaman I just got around to opening up unity under what menu is the Cinemachine script located? I see everything else but that under Window>ReWired I checked under extras and integration and didn't see anything Cinemachine related.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on August 03, 2018, 04:32:44 PM
I just uploaded the update yesterday. The Unity Asset store has not published it yet. 1.1.19.0.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: mrminico on August 03, 2018, 09:29:15 PM
I just uploaded the update yesterday. The Unity Asset store has not published it yet. 1.1.19.0.

Got it as soon as it rolls out i'll definitely check it out and let you know if everything worked fine. Thanks for making this possible Guavaman!
Title: Re: Rewired/Cinemachine Actions discussion
Post by: mrminico on August 08, 2018, 03:19:43 AM
I just uploaded the update yesterday. The Unity Asset store has not published it yet. 1.1.19.0.

Hey Guavaman,

I got around to getting the update everything worked! Just that when I move the joystick left and right it slightly turns the camera diagonally down. And the values are not like the original input I previously had it all feels off :/

I also wanted to know when it comes to using unity input override does that play well with Cinemachine script?

Lastly for the cinemachine script to override the player do I attach it to the camera? Let's say if I have more than 1 player in the scene and each has their own free look cam I want to control does the script go attached on the virtual cam?
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on August 08, 2018, 08:50:20 AM
Just that when I move the joystick left and right it slightly turns the camera diagonally down. And the values are not like the original input I previously had it all feels off :/

There's no way possible that the Cinemachine integration is responsible for that. If you look at the code, you'll see that only input for the named Action requested is queried. There's no way any value from another Action could possibly be getting mixed in causing it to rotate downward. It sounds to me like your joystick is drifting. The default radial deadzone will not stop a downward drift because the deadzone is based on the total magnitude of the input vector. Once the magnitude goes beyond the threshold, both values from the X and Y axes are used. This is the only way to get a smooth look input that doesn't clamp at the 4 cardinal directions. If you don't like this, change the default deadzone to Axial in the Rewired Input Manager settings.

I also wanted to know when it comes to using unity input override does that play well with Cinemachine script?

The Cinemachine bridge queries the Rewired Player directly for input. It is not affected in any way by Unity Input Override.

Lastly for the cinemachine script to override the player do I attach it to the camera? Let's say if I have more than 1 player in the scene and each has their own free look cam I want to control does the script go attached on the virtual cam?

No. There is no support for multiple Players in Cinemachine. Look at the Cinemachine code. The delegate that is provided in the CinemachineCore class to override to change the input source is a single static delegate. You have only one single global static delegate which can be swapped to change the source of input. That means only one player is possible because Cinemachine has one single delegate which is used as the source of input. The Cinemachine integration is not an enhancement or upgrade to Cinemachine that will make it possible to use multiple Players to control multiple look cameras. That would require significant changes all over the Cinemachine code.

The only thing you can do is to change the Player Id in the inspector or on the static property dynamically to swap which Player is in control of Cinemachine.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on August 08, 2018, 08:53:50 AM
If it "feels different" the only thing that would cause that is the code to convert absolute axis values into deltas to work better with the Cinemachine code. The result is the stick is going to be less overly sensitive than before. If you want it to be overly sensitive like it was before, increase the Absolute Axis Sensitivity in the inspector or by using the static property.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: mrminico on August 13, 2018, 05:17:17 PM
No. There is no support for multiple Players in Cinemachine. Look at the Cinemachine code. The delegate that is provided in the CinemachineCore class to override to change the input source is a single static delegate. You have only one single global static delegate which can be swapped to change the source of input. That means only one player is possible because Cinemachine has one single delegate which is used as the source of input. The Cinemachine integration is not an enhancement or upgrade to Cinemachine that will make it possible to use multiple Players to control multiple look cameras. That would require significant changes all over the Cinemachine code.

The only thing you can do is to change the Player Id in the inspector or on the static property dynamically to swap which Player is in control of Cinemachine.

Thats quite unfortunate,

I'm a newbie programmer at best so it'll be quite hard for me to understand anything made in these scripts especially if its coded by pros like you guys haha. Now It is possible to control multiple freelook cameras with other controllers using Unity's Input system. It's easy and all I had to do was enter the string from the input manager for players 1 and 2. Also, change the camera's layers in the culling section to one different from player 1. I'd really hate to drop the use of ReWired over Cinemachine since Cinemachine is a very important part of the game. What I'll do is just experiment with whatever tools you have given me (Thanks a lot by the way!) and use ReWired's Unity Input Override to use Cinemachine. I should get it to work somehow, Thanks for all your assistance Guavaman! :)
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on August 13, 2018, 11:57:03 PM
No. There is no support for multiple Players in Cinemachine. Look at the Cinemachine code. The delegate that is provided in the CinemachineCore class to override to change the input source is a single static delegate. You have only one single global static delegate which can be swapped to change the source of input. That means only one player is possible because Cinemachine has one single delegate which is used as the source of input. The Cinemachine integration is not an enhancement or upgrade to Cinemachine that will make it possible to use multiple Players to control multiple look cameras. That would require significant changes all over the Cinemachine code.

The only thing you can do is to change the Player Id in the inspector or on the static property dynamically to swap which Player is in control of Cinemachine.

Thats quite unfortunate,

I'm a newbie programmer at best so it'll be quite hard for me to understand anything made in these scripts especially if its coded by pros like you guys haha. Now It is possible to control multiple freelook cameras with other controllers using Unity's Input system. It's easy and all I had to do was enter the string from the input manager for players 1 and 2. Also, change the camera's layers in the culling section to one different from player 1. I'd really hate to drop the use of ReWired over Cinemachine since Cinemachine is a very important part of the game. What I'll do is just experiment with whatever tools you have given me (Thanks a lot by the way!) and use ReWired's Unity Input Override to use Cinemachine. I should get it to work somehow, Thanks for all your assistance Guavaman! :)

The only way you could actually make it use separate Rewired Players for each camera is to encode a player id into the string, parse it, and choose the Rewired Player based on that string. (Like Player0_MouseX, split that to find the Player and the Action name). This is ugly and will generate garbage. Either that or have a fixed list of Action names and map each individual Axis name to a Rewired Action and Rewired Player id by creating a lookup table. ("Player0_MouseX" = Player 0, "MouseX".) Neither method is very pretty.

Your example of controlling multiple cameras using Unity's Input Manager could be done just as easily using Rewired. If you have to use multiple Axis names in the Unity Input Manager, you could just as easily use multiple Action names in Rewired. They'd all be controlled by the same Rewired Player. but that's exactly what you're doing using Unity's input system. It's ugly to make a single Player with multiple different Actions to control multiple cameras, but it can certainly be done and is no less functional that using Unity's input manager in the same manner.

I guess I'm going to have to re-do the Cinemachine integration. It will have to be a MonoBehaviour if it requires Axis to Action mappings.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on August 14, 2018, 12:43:45 AM
https://www.dropbox.com/s/luqrb6e9nhk2p1e/RewiredCinemachineBridge.zip?dl=0

There's a new bridge. Replace the existing bridge files in Rewired/Integration/Cinemachine.

You have to map Axis names to each Player in the inspector. Each Player id has a list of Action mappings where you must set the Unity axis name and the Rewired Action name. If you have more than one Player, you must use unique axis names for each Cinemachine axis so it can be associated to the Player.

For example:
Player1 Mouse X
Player1 Mouse Y
Player2 Mouse X
Player2 Mouse Y

Then in the inspector, set up 2 Players, and underneath each add the respective mappings:

Player Id: 0
Action Mapping: "Player1 Mouse X" = "Mouse X"
Action Mapping: "Player1 Mouse Y" = "Mouse Y"

Player Id: 1
Action Mapping: "Player2 Mouse X" = "Mouse X"
Action Mapping: "Player2 Mouse Y" = "Mouse Y"

I will probably make a custom inspector for this in the next update, but the next Rewired update will not be for a long time due to some very big changes I'm having to make for IL2CPP Win/OSX.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on August 14, 2018, 07:09:11 PM
I've updated the script with full inspector action mapping and a number of other features.

https://www.dropbox.com/s/luqrb6e9nhk2p1e/RewiredCinemachineBridge.zip?dl=0
Title: Re: Rewired/Cinemachine Actions discussion
Post by: mrminico on August 20, 2018, 10:35:30 AM
I've updated the script with full inspector action mapping and a number of other features.

https://www.dropbox.com/s/luqrb6e9nhk2p1e/RewiredCinemachineBridge.zip?dl=0

Oh wow thanks! I just saw this I'll definitely check this out as soon as I have the time. And once again thank you for all your assistance literally makes me see why this product was worth the money.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on August 20, 2018, 10:43:48 AM
I've already released the new update that includes the final new version of the Cinemachine integration. It will be available on the Unity Asset Store most likely this week.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: mrminico on August 20, 2018, 11:07:36 AM
I've already released the new update that includes the final new version of the Cinemachine integration. It will be available on the Unity Asset Store most likely this week.

Awesome! I'll give you feedback on it as soon as I test it out I know this isn't a priority so I wouldn't want to distract you from whatever roadmap you have planned for ReWired. I really appreciate the time you spent on small integration. Thanks again!

Just one question tho. Does cinemachine API locks you out of using inputs? I see we have to use mouse X and Y. I was giving it some thought and perhaps because me using the mouse x & y through the joystick was the reason it all felt off. I know cinemachine lets you plug in unity's input but i just found it weird you didn't use input instead. You probably had your reasons for that I was just wondering ^_^
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on August 20, 2018, 11:57:42 AM
I've already released the new update that includes the final new version of the Cinemachine integration. It will be available on the Unity Asset Store most likely this week.

Awesome! I'll give you feedback on it as soon as I test it out I know this isn't a priority so I wouldn't want to distract you from whatever roadmap you have planned for ReWired. I really appreciate the time you spent on small integration. Thanks again!

Just one question tho. Does cinemachine API locks you out of using inputs? I see we have to use mouse X and Y. I was giving it some thought and perhaps because me using the mouse x & y through the joystick was the reason it all felt off. I know cinemachine lets you plug in unity's input but i just found it weird you didn't use input instead. You probably had your reasons for that I was just wondering ^_^

No you do not have to use mouse X and mouse Y. Those are nothing but names of Actions. You can call them whatever you want. The entire purpose of the integration is to be able to use Rewired, which by definition means you can use any controller type you want. The reason they start "Mouse X" and "Mouse Y" is that is what the Cinemachine camera scripts use for the default action names. They're just defaults.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: mrminico on August 20, 2018, 04:01:02 PM
Quote
No you do not have to use mouse X and mouse Y. Those are nothing but names of Actions. You can call them whatever you want. The entire purpose of the integration is to be able to use Rewired, which by definition means you can use any controller type you want. The reason they start "Mouse X" and "Mouse Y" is that is what the Cinemachine camera scripts use for the default action names. They're just defaults.

WOOOOW No wonder I using ReWired mouse inputs to control the cameras through joystick instead of using Controller inputs. Alright, I definitely have tons of testing to do I'll definitely do it all as soon as I get the time to. Thanks for the information Guavaman :)
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on August 20, 2018, 04:30:31 PM
WOOOOW No wonder I using ReWired mouse inputs to control the cameras through joystick instead of using Controller inputs.

This statement is quite confusing to me. What do you mean by "using Rewired mouse inputs?" If you are using Rewired to control the camera with a joystick, you're using Rewired to control the camera with a joystick. There's no way possible you could be accidentally using the mouse to control a joystick.

In Rewired, there are nothing but:
Actions
Controller Maps

Your Actions can be named whatever you want. You can call them:
Look X
Mouse X
Upside-down Flying Ninja Robot Zombie Pizza from Galaxy X

Regardless of the name, they are all exactly the same.

To use these Actions, you must create some Controller Maps for the different controller types you want to support.

When you create a Controller Map for a Joystick, you are creating bindings between joystick elements and Actions.

When you create a Controller Map for a Mouse, you are creating binding between mouse elements and Actions.

Even if that Action's name was "Mouse X", when you made a Joystick Map using that Action, it's equally as valid as making a Joystick Map with an Action named "Look X." There's absolutely no difference.

If you were using Actions in Rewired called "Mouse X" and "Mouse Y" and making Joystick Maps with those two Actions, that's perfectly valid and will work. You will get the exact same result as if you change the names to "Look X" and "Look Y".
Title: Re: Rewired/Cinemachine Actions discussion
Post by: mrminico on August 21, 2018, 08:34:49 PM
WOOOOW No wonder I using ReWired mouse inputs to control the cameras through joystick instead of using Controller inputs.

This statement is quite confusing to me. What do you mean by "using Rewired mouse inputs?" If you are using Rewired to control the camera with a joystick, you're using Rewired to control the camera with a joystick. There's no way possible you could be accidentally using the mouse to control a joystick.

In Rewired, there are nothing but:
Actions
Controller Maps

Your Actions can be named whatever you want. You can call them:
Look X
Mouse X
Upside-down Flying Ninja Robot Zombie Pizza from Galaxy X

Regardless of the name, they are all exactly the same.

To use these Actions, you must create some Controller Maps for the different controller types you want to support.

When you create a Controller Map for a Joystick, you are creating bindings between joystick elements and Actions.

When you create a Controller Map for a Mouse, you are creating binding between mouse elements and Actions.

Even if that Action's name was "Mouse X", when you made a Joystick Map using that Action, it's equally as valid as making a Joystick Map with an Action named "Look X." There's absolutely no difference.

If you were using Actions in Rewired called "Mouse X" and "Mouse Y" and making Joystick Maps with those two Actions, that's perfectly valid and will work. You will get the exact same result as if you change the names to "Look X" and "Look Y".

Sorry for the confusion By Mouse X and Y I was referring to the Mouse Axis. I thought ReWired Cinemachine integration only worked with those. I'm well aware that naming conventions don't matter in this case but thank you once again! :)
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on August 21, 2018, 08:41:30 PM
WOOOOW No wonder I using ReWired mouse inputs to control the cameras through joystick instead of using Controller inputs.

This statement is quite confusing to me. What do you mean by "using Rewired mouse inputs?" If you are using Rewired to control the camera with a joystick, you're using Rewired to control the camera with a joystick. There's no way possible you could be accidentally using the mouse to control a joystick.

In Rewired, there are nothing but:
Actions
Controller Maps

Your Actions can be named whatever you want. You can call them:
Look X
Mouse X
Upside-down Flying Ninja Robot Zombie Pizza from Galaxy X

Regardless of the name, they are all exactly the same.

To use these Actions, you must create some Controller Maps for the different controller types you want to support.

When you create a Controller Map for a Joystick, you are creating bindings between joystick elements and Actions.

When you create a Controller Map for a Mouse, you are creating binding between mouse elements and Actions.

Even if that Action's name was "Mouse X", when you made a Joystick Map using that Action, it's equally as valid as making a Joystick Map with an Action named "Look X." There's absolutely no difference.

If you were using Actions in Rewired called "Mouse X" and "Mouse Y" and making Joystick Maps with those two Actions, that's perfectly valid and will work. You will get the exact same result as if you change the names to "Look X" and "Look Y".

Sorry for the confusion By Mouse X and Y I was referring to the Mouse Axis. I thought ReWired Cinemachine integration only worked with those. I'm well aware that naming conventions don't matter in this case but thank you once again! :)

Are you saying you were using ReInput.controllers.Mouse to get the values of the mouse directly? Because if you're using Player-Actions, you're using whatever current input device is mapped to those Actions and assigned to the Player whether it be a mouse, joystick, or keyboard.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: mrminico on August 21, 2018, 09:11:16 PM
WOOOOW No wonder I using ReWired mouse inputs to control the cameras through joystick instead of using Controller inputs.

This statement is quite confusing to me. What do you mean by "using Rewired mouse inputs?" If you are using Rewired to control the camera with a joystick, you're using Rewired to control the camera with a joystick. There's no way possible you could be accidentally using the mouse to control a joystick.

In Rewired, there are nothing but:
Actions
Controller Maps

Your Actions can be named whatever you want. You can call them:
Look X
Mouse X
Upside-down Flying Ninja Robot Zombie Pizza from Galaxy X

Regardless of the name, they are all exactly the same.

To use these Actions, you must create some Controller Maps for the different controller types you want to support.

When you create a Controller Map for a Joystick, you are creating bindings between joystick elements and Actions.

When you create a Controller Map for a Mouse, you are creating binding between mouse elements and Actions.

Even if that Action's name was "Mouse X", when you made a Joystick Map using that Action, it's equally as valid as making a Joystick Map with an Action named "Look X." There's absolutely no difference.

If you were using Actions in Rewired called "Mouse X" and "Mouse Y" and making Joystick Maps with those two Actions, that's perfectly valid and will work. You will get the exact same result as if you change the names to "Look X" and "Look Y".

Sorry for the confusion By Mouse X and Y I was referring to the Mouse Axis. I thought ReWired Cinemachine integration only worked with those. I'm well aware that naming conventions don't matter in this case but thank you once again! :)

Are you saying you were using ReInput.controllers.Mouse to get the values of the mouse directly? Because if you're using Player-Actions, you're using whatever current input device is mapped to those Actions and assigned to the Player whether it be a mouse, joystick, or keyboard.

Alright I opened unity up so I can retrace everything I did so there wont be any more confusion. (Sorry in advance  :'( my ReWired terminology is all off)

Heres What I did:

I used a mouse map for the right analog sticks and assigned mouse horizontal and mouse Vertical in the element section. I then assigned the mouse map to the player. At the time I thought only mouse maps would work with the integration.
 
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on August 22, 2018, 12:12:57 AM
WOOOOW No wonder I using ReWired mouse inputs to control the cameras through joystick instead of using Controller inputs.

This statement is quite confusing to me. What do you mean by "using Rewired mouse inputs?" If you are using Rewired to control the camera with a joystick, you're using Rewired to control the camera with a joystick. There's no way possible you could be accidentally using the mouse to control a joystick.

In Rewired, there are nothing but:
Actions
Controller Maps

Your Actions can be named whatever you want. You can call them:
Look X
Mouse X
Upside-down Flying Ninja Robot Zombie Pizza from Galaxy X

Regardless of the name, they are all exactly the same.

To use these Actions, you must create some Controller Maps for the different controller types you want to support.

When you create a Controller Map for a Joystick, you are creating bindings between joystick elements and Actions.

When you create a Controller Map for a Mouse, you are creating binding between mouse elements and Actions.

Even if that Action's name was "Mouse X", when you made a Joystick Map using that Action, it's equally as valid as making a Joystick Map with an Action named "Look X." There's absolutely no difference.

If you were using Actions in Rewired called "Mouse X" and "Mouse Y" and making Joystick Maps with those two Actions, that's perfectly valid and will work. You will get the exact same result as if you change the names to "Look X" and "Look Y".

Sorry for the confusion By Mouse X and Y I was referring to the Mouse Axis. I thought ReWired Cinemachine integration only worked with those. I'm well aware that naming conventions don't matter in this case but thank you once again! :)

Are you saying you were using ReInput.controllers.Mouse to get the values of the mouse directly? Because if you're using Player-Actions, you're using whatever current input device is mapped to those Actions and assigned to the Player whether it be a mouse, joystick, or keyboard.

Alright I opened unity up so I can retrace everything I did so there wont be any more confusion. (Sorry in advance  :'( my ReWired terminology is all off)

Heres What I did:

I used a mouse map for the right analog sticks and assigned mouse horizontal and mouse Vertical in the element section. I then assigned the mouse map to the player. At the time I thought only mouse maps would work with the integration.

Thanks for explaining. My confusion is coming from your mixture of joystick terms in while you're talking about the mouse. Here you say you used a mouse map for the "right analog sticks" which doesn't make sense to me because the mouse has no relationship to any analog sticks and a mouse map cannot be used on a joystick. If I understand correctly, you mean you created mouse map to control the Cinemachine camera's X and Y axes, but you did not know you could also map these actions on a Joystick Map and use a joystick to control the camera. That makes sense if that's the case.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: mrminico on August 23, 2018, 12:59:05 AM
Quote
Thanks for explaining. My confusion is coming from your mixture of joystick terms in while you're talking about the mouse. Here you say you used a mouse map for the "right analog sticks" which doesn't make sense to me because the mouse has no relationship to any analog sticks and a mouse map cannot be used on a joystick. If I understand correctly, you mean you created mouse map to control the Cinemachine camera's X and Y axes, but you did not know you could also map these actions on a Joystick Map and use a joystick to control the camera. That makes sense if that's the case.

Yesss! Exactly that sorry for the confusion. But that's exactly what I did I'll be trying the joystick map as soon as I'm back the project that uses ReWired. You have been phenomenally helpful Guavaman! Thanks for all the support and assistance. If there's anything else in regards to Playmaker / ReWired I'll make sure to mention you. I'll come back here once I've experimented with the updated cinemachine integration just to let you know that everything is okay.
Title: Re: Rewired/Cinemachine Actions discussion
Post by: craigz on August 23, 2018, 01:25:58 PM
Thanks for starting this thread and for the updates Guavaman! I'd been keeping tabs over on the Unity Forum for a workaround for this, so its nice to see it officially integrated :D
Title: Re: Rewired/Cinemachine Actions discussion
Post by: Guavaman on August 23, 2018, 09:54:03 PM
Thanks!