|
Post by archieandrews on Jul 17, 2019 14:51:03 GMT
Hi I have the following code to constrain the limit Angle Y:
vCamera.currentState.yMaxLimit = 2f; vCamera.currentState.yMinLimit = 2f;
I set a debug.log to read that current state
Debug.Log(vCamera.currentState.yMaxLimit);
This reads correctly however the limits are not being imposed on the cam control. If I manually edit the sliders in the editor it takes effect just not on via code even though the debug is reading current Limit correctly.
I also have code that sets height and distance: These work fine! vCamera.currentState.defaultDistance = NewDistance; vCamera.currentState.height = SetHeight = NewHeight;
Any ideas? NOTE: I have "use instance" disabled on 3rd person controller as I do not want to transfer character from scene to scene
I suppose I could use different camera states but my intent is to be able to edit on the fly in game to whenever I require it.
TY
|
|
|
Post by Invector on Jul 17, 2019 20:26:26 GMT
|
|
|
Post by archieandrews on Jul 18, 2019 10:17:22 GMT
Thanks Actually I just got it to work with vCamera.currentState I just needed to add the code in Update not Start.
I understand you have moved a lot of these paramaters to access them in the 3rdPerson input via TP_Input but is it still OK to use vCamera instead? (public vThirdPersonCamera vCamera;)
Its working for me so ... but I did notice it made a permanent change to the editor values stored from last values during game run mode
Cheers! A
|
|