This topic is based off of the Third Person Camera - Made by Mobious from Blendswap.
I’ve been trying (And failing) at optimizing a 3rd person view with the point of view off center to the left or right of the player’s character when zoomed in, yet more or less centered when you zoom further out. For example, Uncharted.
For a long time, I just used modified versions of Mobious’ setup, but the problem is, the way he achieves the offset to the left or right allows the camera to clip through the walls that amount. Here’s a file with his code, as the original file of his seems to be gone.
Controls: (Standard MMOG)
Q,E = rotate
WASD strafe/walk
SHIFT=Run (Use this, walking is slow.)
Middle mouse button changes side of offset.
So, as you can see, if you open the file, and put the highlighted “HOR_OFFSET” value to 0.0 instead of 3.0, the collision works perfectly, but there’s no offset-over the shoulder view. If you leave it at 3.0, you get the side offset, but now you can clip through the walls and see the green horizon waiting to consume you. (Shrugs)
Any ideas on how this can be corrected. while keeping horizontal, toggleable left right offset? I’ve everything I can think of, code and camera-rig.
I Haven’t Download The File Yet On My Phone… I’m Just Rough Guessing Here… If You Use Mouse And Camera To Match Center… It Always Stays At Center Of The Camera… But If You Put A Cube In Front Of The Eye Parented To Eye And Another Cube In Front Of The Camera Or Back Of The Camera And Set The Cube Tracking The Cube In Front If The Eye Follow xy Location… Camera Move To xy Location Of The Back Cube… Got Yourself An Offset… And Use The Mouse As Main Cursor Later To Handle The Rotation Of The Camera Where The Mouse Cursor And Camera Always At Center…
Thank you for your reply! You are right, that’s a traditional workaround, however, an angle will still return the clipping effect, and when whatever object the camera is parented (in order to use the script) is clear of any collisions, there will always be one spot where whatever object/script controlling the camera is parallel to a surface, but the offset angle allows the view to clip into walls.
I’m not perfect at explaining it. That’s why I included the blend. XD
In 1person Mode… Don’t Have To Worry Bout Those Stuff Right… Because The Camera Is Already Mounted To The Eyes… In 3rd Person Mode The Camera Follows Behind… There Will Be A Probability That The Camera Might Sink To The Wall… Whatever It Is… When A Head Is Turn And The Came Moving On The Opposite Rotation Camera Target Parallel To The Eye Trajectory Probably That Would Evade Any Camera Sinking To Wall… And I’m Just Saying If You Use A Code Method… If It Can Saves You Time For Future Task… Just Use It…
i set to point in space, add a little bit extra distance, then raycast to it. the camera position is set to the original point, if the raycast hits, then set the position to hitpoint minus the added distance.
seems to work well for shoulder view too. the code is in the player controller demo i posted.
theres a shoulder view mode, but i might need to add it back in. setting camera state to CAM_TYPE = "SHOULDER" might work. seems i forgot to add CAM_SHSIDE variable to define the X offset.