Hi. My main idea is to make a very simple mechanic for picking up and throwing items.
I made a pretty solid free look camera with three rigs and a script for picking up objects.
Now, I want when mouse 1 is pressed and hold to activate “over the shoulder” or just a little zoom camera which will help me to aim easier.
I need the player to be able to aim with a crosshair and throw the item in that direction where the crosshair points.
Very similar to this - x.com
(Only the zoom and throw items, not the climb part)
I made a second camera, but now my main problem is that my “zoomed” camera does not correspond to the character inputs and does not rotate with the character so it’s impossible to try implement the throwing mechanic
Basically, I found that this approach may be the right one for me. Unfortunately I am not able to integrate the solution for the aim camera in my script. I tried copying the methods and variables with no success. Can somebody help me with that? Thanks!
Yes, that is the solution I would have recommended. Have a look at the AimingRig sample scene that ships with Cinemachine. That might help with integration.
Hey Gregoryl. Thanks for the response! I was trying to integrate the aimriggin from the sample scenes but with no success.
Here is what i’ve done until now - As u can see, I my main camera is ready to go, but after I zoom only the crosshair is moving, and the player is rotating with ‘w a s d’
This is the script i’ve attached in my second camera. I know maybe it’s bad to put the commands in the camera change script but I am trying to make the things simpler instead of putting all this code in my character controller script.
It’s not clear to me from the video what it is that you don’t like. It seems that in zoom mode, the character is always facing away from the camera, looking at the reticle, and when you move the mouse the whole thing rotates. Is that not what you want?
Your code does indeed look strange to me. I think the correct paradigm is: mouse moves the character (not the camera), and camera tracks the character, always staying behind it in 3rdPerson mode. How do you rotate the character when not in boost mode?
My character does not rotates while I rotate the mouse. Only on ‘w a s d’. I need to be otherwise - The character to rotates when my “crosshair” moves and not on ‘w a s d’. Actually, in this video, my aim is not moving on the y axis, and only the inner circle of the crosshair is moved on x axis
I rotate my character with the “w a s d” when I am not in aim mode
Hi Gregoryl! Thanks for the suggestion. I am still trying to make that but with no success so far
However, I’ve noticed a strange flickering on my character at the very end of my mouse position (just before my mouse stops) Do u have any idea what could it be?
Here is video of the weird flickering of the character, and here is my inspector settings:
Yes, I see the little jump. You have the vcam set up with POV component responding to the mouse. Do you have any other scripts active that are also responding to the mouse movement? If so, can you disable them all and see if you still get the jump?
I literally tried to disable all gameobjects in my scene one by one but nothing fix the problem. Tried to disable the script attached to the zoom camera that is changing the priority but it is not that either.
Can you make a small repro project that shows this problem and send it to me?
EDIT: something else you can try before doing that. In both axes of the POV control, change the speed mode to “input value gain”. You’ll also have to lower the Speed value by a lot (something like 10X). Try that and see if the problem goes away.