Camera State Change Triggers

I have deleted what I wrote earlier because I have figured out how to use the camera triggers using the 2.5D scene trigger in the demo scene. That really works awesome.

I have managed to create a 2.5D sniper camera preset which is activated when i hold the right mouse button for the sniper shot effect, which places the character to the bottom left corner of the screen and zooms out quite a bit to open up a large portion of the surrounding area for a sniper shot. I am running into two problems that I could not resolve:

1) SOLVED: (I have added the zoom out state to the bow, and gave up on the second action for the bow, so it works for me now) The shot seems to be zooming back in too prematurely, since I linked it to the use ability. So as soon as the bow is released, it will zoom back to default, which causes the result of the shot to be missed. I could try to bring back the aim ability, and set the state for that ability, but I really like to keep the LMB for quick bow attacks. So I am looking for a way to cause the preset state to linger a certain amount after a shot was made.

2) Right now the character is automatically placed on the bottom left corner of the screen during the snipe shot. But that only works for enemies on the right hand side :) Is there a way to use the preset system to open up the screen towards the mouse cursor? Or would I need to code this entirely separately from the camera controller? Since the character has a fixed Z axis, that would require the X Anchor Offset to be modified based on the difference of the x transforms of the player character and the mouse cursor raycast, and that would happen during the snipe state. In other words, when I start pressing RMB, the camera would start panning towards the mouse cursor, until the distance between the two is the same as the screen width (or a smaller set value). Can you give any hints where I should be modifying?

Thank you.
 
Last edited:
For this situation I would directly modify the AnchorOffset rather than using the state system - the state system is more of an on/off type of thing rather than being used for continuous changes.
 
Top