Convert aim ability control for mobile

bluebird

Member
Hi @Justin ,

How can we stop 'aim ability' only after user press a button second time. Currently, aim ability is activated until we pressed Fire2 (right mouse button).

1357
 
yep.
in case of mobile controls, user can take aim with button press and again get back to normal with button press. This will be proper aim control for mobile platforms.
 
Hi @Justin ,

I took reference of 'Crouch' control for implementing this kind of control for Aim.
but unfortunately it's not working like crouch control.

Can you check these config below and tell where's I'm going wrong?

1381

I created a UI button for Aim and passed 'Fire2' as a parameter.

1383
 
I just tried that same setup on an Android build and it worked. When I pressed the button once the character aimed, pressed it again and the character stopped aiming.
 
I just tried that same setup on an Android build and it worked. When I pressed the button once the character aimed, pressed it again and the character stopped aiming.

This is already working. But I forgot to mention that camera can't zoom when aim ability is active.
I captured screenshots while aim ability was active:

Now:

1408

I want, Aim and zoom both active together:

1409
 
Hi @Justin

Problem is, the character is 'Aiming' correctly, just the camera doesn't maintain the zoom.

what I can do is, manually call a method of StateManager class which enables/disables 'Zoom' state of camera
StateManager.SetState(cameraController.gameObject, "Zoom", true);

Can you tell me where can I find a logic for each virtual buttons? so I will add above line there.

Let me know, if there is other way to achieve this? or should I go ahead with what I described?
 
Last edited:
Just to raise awareness a bit. Currently on that exact same situation.
Ended up tweaking inside the CameraControllerHandler, maybe there's a way to make a proper adapter component around that one or inherit from that class and react accordingly.

1421

Some users on the Discord have suggested workarounds which might be better solutions.
(Like putting blocker states on camera).
 
Top