[FREE] First Person Camera Add-on [2.5.1]
Aug 16, 2016 14:38:34 GMT
Invector, jgiroux, and 7 more like this
Post by sjmtech on Aug 16, 2016 14:38:34 GMT
First Person Camera Add-on
Templates:
- inVector Basic Locomotion
- inVector Melee Combat
- inVector Shooter
AddOn:
- FreeClimb
- Swimming
- Zipline
- Builder
Integrations:
- FINAL IK
- Horse Animset Pro 4
Changelog:
(Update 10/05/2020)
- Updated to HAP 4.0.8 Integration
(Update 06/05/2020)
- Checked compatibility to Invector-AI Controller 1.1.1
(Update 05/05/2020)
- Updated to inVector Template Basic/Melee /Shooter 2.5.1
(Update 16/01/2020)
- Fixed weird body rotation on sprint.
(Update 31/12/2019)
- Added compatibility with last Horse AnimSet Pro integration;
Content/Instructions:
----------------------------------------------------------------------------------------------------
Content:
----------------------------------------------------------------------------------------------------
- vFirstPersonCamera.CS : The main script.
- vFirstPersonCameraSwap.CS: (OPTIONAL) for ingame First/Third camera swap.
- simple demo scene
Instructions:
----------------------------------------------------------------------------------------------------
vFirstPersonCamera.CS
***********************
1 - drop the inVector Controller prefab on your scene ad add this script on it.
2 - remove all ThirdCamera by invector in scene; add a new camera and set it as MainCamera (or add a custom camera in "PC Camera" field.
3 - use the ContextMenu to set manually the camera in the right position.
vFirstPersonCameraSwap
***********************
1 - add the vFirstPersonCameraSwap component to the player gameObject
2 - assign the third camera prefab in inspector
Optional code modifications:
*** SHOOTER 2.5.1 ***************
vShootermanager.cs
-------------------------------------------------------------------------------------------------------------------
Add Camera Sway support - replace line 744 with:
else
{
gameObject.SendMessage("SetOffset",new Vector2(bx + tx,by + ty),SendMessageOptions.DontRequireReceiver);
}
Add Camera Recoil support - replace line 708 with:
if (tpCamera != null && applyRecoilToCamera)
{
tpCamera.RotateCamera(horizontal, up);
}
else
{
gameObject.SendMessage("SetRecoil",new Vector2(horizontal,up),SendMessageOptions.DontRequireReceiver);
}
vShooterIKAdjustWindow.cs
-------------------------------------------------------------------------------------------------------------------
Replace lines from 148 to 151 with:
shooter = FindObjectOfType<vShooterMeleeInput>() as vShooterMeleeInput;
if (shooter.tpCamera != null)
{
if (useLockCamera && GUILayout.Button(LockCamera ? "Unlock Camera" : "Lock Camera", EditorStyles.miniButton))
{
LockCamera = !LockCamera;
}
}
else
{
vFirstPersonCamera fpCamera = FindObjectOfType<vFirstPersonCamera>() as vFirstPersonCamera;
if (useLockCamera && GUILayout.Button(fpCamera.disableMouseInput ? "Unlock FPCamera" : "Lock FPCamera", EditorStyles.miniButton))
{
fpCamera.disableMouseInput = !fpCamera.disableMouseInput;
fpCamera.resetHeadPosition = !fpCamera.resetHeadPosition;
}
}
Add at line 5
using Invector.vCharacterController;
Add at line 17
vShooterMeleeInput shooter;
ADD-ON
-------------------------------------------------------------------------------------------------------------------
**** vBuilder ****
vBuildObject.CS
-------------------------------------------------------------------------------------------------------------------
replace line 227 with:
var dir = parent.position - Camera.main.transform.position - new Vector3(0, 0, 1);
INTEGRATIONS
-------------------------------------------------------------------------------------------------------------------
**** Horse AnimSet Pro 4 ****
Import the included pack with edited Invector HAP Link components.
add to M Rider events - (vFirstPersonCamera)isAction true/false - for OnEndMounting/OnEndDismounting
add to M Rider events - (vFirstPersonCamera)isCinematic true/false - for OnStartMounting/OnEndDismounting
Packages:
Camera Add-On Package (2.5.1) - <05-05-2020>
Camera Add-On Package (2.5.0) - <16-01-2020>
-----------------------------
Shooter
Melee/Conbat
Zipline Addon
Swimming Addon
Horse Animset Pro Integration