Change view type

On the main camera under the View Type is a section labeled "OnChangeViewType" which tells me there must be a way to change the View Type in game my question is can I set it up to change View Type on a button push/toggle and if so can I also set up the Movement Type on the Character to change on a button push/toggle so the View type and the Movement type always match? I have tried to do this manually outside play mode just to see and I always get an error about the view type and the movement type not matching. so any advice on this would be very helpful

thanks
 
@Andrew I stumbled across this trying to make an ability that changes the movement/view type at runtime. It seemed like what I needed. When I try the first piece of code from the API however, "GetType" doesn't seem to work as described in the example.

How do you get the view types? Basically i'm trying to check if the view type is "Combat" (in third person), change it to "Action"
 
@Andrew well, it's not so much of what I'm expecting it to return (I would expect it to return the movement type as defined in the "viewTypeName" variable.). It's more so that I can't use it because it gives an error in the editor

Taking the first code example as is from the camera API documentation gives two errors.
1. UnityEngineUtility does not contain a definition for FindCamera
2. No overload for GetType takes 1 argument

I'm unsure when this example was written but it looks like it might be outdated?

For #1, I assume the fix is Camera.main which does seem to get me the camera.
 
sounds liike an easy option here is the state system. you can have a button press activate a state and then have presets on the camera controller and characterlocomotion that change the view type and movement type. I use this a lot with no problems, the only painful thing is knowing the names, for example this is the name of a viewtype that you would have to enter into the preset: "Opsive.UltimateCharacterController.ThirdPersonController.Camera.ViewTypes.Adventure"
Once you have presets like this you can use the setstate code as an alternative to the ability.
 
@DankP3 Yeah I just about did this and it seems to do what I need it to, except for one thing.

The animation..? When I activate the ability, the correct ViewType and MovementType are set but, shouldn't the "MovementSetId" in the animator parameters change? (I'm using the demo animator for now btw)
 
Top