|
Post by irracalma on Mar 15, 2023 8:09:52 GMT
Im using the vTpCameraCinemachine but the LockOn is not working with Cinemachine. when i use the regular vThirdPersonCamera works perfectly. Any suggestions?
|
|
|
Post by Invector on Mar 15, 2023 13:26:12 GMT
Open the vLockOnBehavior and search for the line that access the tpCamera
tpCamera = Camera.main.transform.root.GetComponent<vCamera.vThirdPersonCamera>();
Instead of getting the vThirdPersonCamera component you will need to get the vTpCameraCinemachine
|
|
|
Post by irracalma on Jun 5, 2023 20:39:37 GMT
I already try that but i still getting errors:
NullReferenceException: Object reference not set to an instance of an object Invector.vCharacterController.vLockOnBehaviour.SortTargets (System.Collections.Generic.List`1[UnityEngine.Transform]& list) (at Assets/Invector-3rdPersonController/Melee Combat/Scripts/LockOn/vLockOnBehaviour.cs:316) Invector.vCharacterController.vLockOnBehaviour.GetPossibleTargets () (at Assets/Invector-3rdPersonController/Melee Combat/Scripts/LockOn/vLockOnBehaviour.cs:298) Invector.vCharacterController.vLockOnBehaviour.UpdateLockOn (System.Boolean value) (at Assets/Invector-3rdPersonController/Melee Combat/Scripts/LockOn/vLockOnBehaviour.cs:131) Invector.vCharacterController.vLockOn.LockOn (System.Boolean value) (at Assets/Invector-3rdPersonController/Melee Combat/Scripts/LockOn/vLockOn.cs:163) Invector.vCharacterController.vLockOn.LockOnInput () (at Assets/Invector-3rdPersonContro
|
|
|
Post by Invector on Jun 9, 2023 14:02:06 GMT
There is no time for the code to find the component because when you start the game the MainCamera object is unparented.
To fix this you can manually assign the tpCamera by making the variable public on line 40 and comment the getcomponent in the init method
//tpCamera = Camera.main.transform.root.GetComponent<vCamera.vTpCameraCinemachine>();
|
|
|
Post by irracalma on Sept 17, 2023 5:33:35 GMT
I have done all the changes you told but I still having the same error and a new one: Assets/Invector-3rdPersonController/Melee Combat/Scripts/LockOn/vLockOnBehaviour.cs(339,69): error CS1061: 'CinemachineVirtualCamera' does not contain a definition for 'WorldToScreenPoint' and no accessible extension method 'WorldToScreenPoint' accepting a first argument of type 'CinemachineVirtualCamera' could be found (are you missing a using directive or an assembly reference?)
|
|
|
Post by Invector on Sept 25, 2023 12:46:31 GMT
Do oyu have a virtual camera from cinemachine in your scene?
|
|
|
Post by irracalma on Nov 6, 2023 21:50:19 GMT
Yes, I already solve it with the first instruction you gave me, I didn't had the tags set correctly. Thank you, and sorry for the late response
|
|