nesh88
Junior vMember
Posts: 45
|
Post by nesh88 on Jul 27, 2020 19:16:19 GMT
I was able t oachieve what I needed, thank you! About the vMessageReceiver and vMessageSender I could not find anything. Could you please provide a link as I tried to find info in the pdf and in the forum and was unlucky to find more info
|
|
|
Post by Invector on Jul 28, 2020 13:30:03 GMT
I was able t oachieve what I needed, thank you! About the vMessageReceiver and vMessageSender I could not find anything. Could you please provide a link as I tried to find info in the pdf and in the forum and was unlucky to find more info It's a feature from the Basic Locomotion, you can find it on the basic documentation: www.invector.xyz/copy-of-third-person-documentation
|
|
nesh88
Junior vMember
Posts: 45
|
Post by nesh88 on Aug 5, 2020 14:48:14 GMT
Hello, is there any specific "right" way to transfer the camera to another scene. At this moment I use 1 camera at the initial level and 1 in the other scene. Everything works except LockOn and shooting, melee is working just fine. I'm sure that the problem has to do something with the camera as it says:
MissingReferenceException: The object of type 'Camera' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object.
If I use don't destroy the camera do not follow the player in the other scene.
Here is the code I use for the Camera:
using System.Collections.Generic; using UnityEngine; using Invector.vCamera; using Invector.vCharacterController;
public class DestroyCameraInstance : MonoBehaviour { // Start is called before the first frame update public GameObject player; private static DestroyCameraInstance instance; void Awake(){ DontDestroyOnLoad (this); if (instance == null) { instance = this; } else { DestroyObject(gameObject); } }
private void Start() { AssignCameraToPlayer( player); }
public void AssignCameraToPlayer(GameObject playerObject)
{
vThirdPersonCamera thirdPersonCamera = FindObjectOfType<vThirdPersonCamera>();
if (thirdPersonCamera != null)
{
Debug.Log($"Setting target to {playerObject.name}");
thirdPersonCamera.Init();
}
}
}
|
|
nesh88
Junior vMember
Posts: 45
|
Post by nesh88 on Aug 6, 2020 15:39:07 GMT
Bump
- Camera is tagged as MainCamera.
- Camera is assigned to the player, but stil don't follow the player (when the scene is changed)
|
|
nesh88
Junior vMember
Posts: 45
|
Post by nesh88 on Aug 8, 2020 6:19:19 GMT
Tried everything I could find in the forum. Nothing fixes my problem
Edit: I have tried with fresh Invector project and in the Invector_MeleeCombat scene when passing through the portal and I get in the GameOver Scene all seems to be alright, but if you try to LockOn/Strafe (when I press Tab) I'm having the same MissingReferenceException as in my Main project:
Here is the error:
MissingReferenceException: The object of type 'Camera' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. UnityEngine.Camera.get_projectionMatrix () (at <480508088aee40cab70818ff164a29d5>:0) UnityEngine.GeometryUtility.CalculateFrustumPlanes (UnityEngine.Camera camera, UnityEngine.Plane[] planes) (at <480508088aee40cab70818ff164a29d5>:0) UnityEngine.GeometryUtility.CalculateFrustumPlanes (UnityEngine.Camera camera) (at <480508088aee40cab70818ff164a29d5>:0) Invector.vCharacterController.vLockOnBehaviour.SortTargets (System.Collections.Generic.List`1[UnityEngine.Transform]& list) (at Assets/Invector-3rdPersonController/Melee Combat/Scripts/LockOn/vLockOnBehaviour.cs:271) Invector.vCharacterController.vLockOnBehaviour.GetPossibleTargets () (at Assets/Invector-3rdPersonController/Melee Combat/Scripts/LockOn/vLockOnBehaviour.cs:258) Invector.vCharacterController.vLockOnBehaviour.UpdateLockOn (System.Boolean value) (at Assets/Invector-3rdPersonController/Melee Combat/Scripts/LockOn/vLockOnBehaviour.cs:113) Invector.vCharacterController.vLockOn.LockOn (System.Boolean value) (at Assets/Invector-3rdPersonController/Melee Combat/Scripts/LockOn/vLockOn.cs:166) Invector.vCharacterController.vLockOn.LockOnInput () (at Assets/Invector-3rdPersonController/Melee Combat/Scripts/LockOn/vLockOn.cs:108) Invector.vCharacterController.vLockOn.UpdateLockOn () (at Assets/Invector-3rdPersonController/Melee Combat/Scripts/LockOn/vLockOn.cs:94) Invector.vCharacterController.vThirdPersonInput.Update () (at Assets/Invector-3rdPersonController/Basic Locomotion/Scripts/CharacterController/vThirdPersonInput.cs:181)
|
|
|
Post by kingceryn on Aug 9, 2020 3:51:51 GMT
Hello, I have reached a point where I need to implement separate crafting, alchemy, cooking which will all use the same crafting system. The only thing I want to change is different NPCs to offer these services. I really thought that it's easy but I really stuck with this one. It breaks everything. Thanks in advance! Basically you can duplicate the Crafting window and use different ItemTypes for each window and activate those windows using the MessageReceiver component ( check the documentation to see how it works) I'm having this issue as well, trying to duplicate inventory windows and have them share the same crafting function, Whenever i do, the new copy doesnt respond to the rest of it, is there a specific window i need to assign in the inspector on the duplicate copy?
|
|
nesh88
Junior vMember
Posts: 45
|
Post by nesh88 on Aug 9, 2020 6:29:39 GMT
Basically you can duplicate the Crafting window and use different ItemTypes for each window and activate those windows using the MessageReceiver component ( check the documentation to see how it works) I'm having this issue as well, trying to duplicate inventory windows and have them share the same crafting function, Whenever i do, the new copy doesnt respond to the rest of it, is there a specific window i need to assign in the inspector on the duplicate copy? Hey,
Here is what I've done:
1. I have imported my NPC Crafter (which is a 3d model in my case) and I have added it to the scene, then I've added a vTriggerGeneriAction component and trigger collider. I use it to open and close Crafter's UI
2. I have created a new Canvas and in it I've added ItemCraftWindow I duplicated from the original crafting window. I left the original window crafting window as it is, just to try if it works then delete it.
Make sure that you assign your inventory in the vItemWindow so they are connected. Basically, I moved the crafting window to a new canvas. 3. I have duplicated the new crafting window as many times as I needed to have Crafter for Weapons, Jewelry etc.
I have no idea if this is the right approach but it works
|
|
|
Post by kingceryn on Aug 9, 2020 7:46:36 GMT
I'll try this! I'm getting an error regarding something but it goes away when i clear it
|
|
nesh88
Junior vMember
Posts: 45
|
Post by nesh88 on Aug 10, 2020 14:22:23 GMT
Lockon does not work in the GameOver demo scene once I pass the portal (BUMP)
|
|
|
Post by Invector on Aug 10, 2020 17:16:59 GMT
Lockon does not work in the GameOver demo scene once I pass the portal (BUMP) Simple ask if the tpCamera is null and call the Init method to grab the new camera. vLockOnBehavior > SortTargets method > if (tpCamera == null) Init();
|
|
nesh88
Junior vMember
Posts: 45
|
Post by nesh88 on Aug 11, 2020 6:55:54 GMT
Thank you so much! That Worked.
|
|
|
Post by kingceryn on Aug 11, 2020 7:52:18 GMT
Thank you so much! That Worked. Do you happen to know which line you added that in at? I'm getting some errors.
|
|
nesh88
Junior vMember
Posts: 45
|
Post by nesh88 on Aug 11, 2020 15:47:05 GMT
Thank you so much! That Worked. Do you happen to know which line you added that in at? I'm getting some errors. I have added it to the very first line. It won't work if you put it at the end of the Method.
|
|
nesh88
Junior vMember
Posts: 45
|
Post by nesh88 on Aug 13, 2020 17:21:15 GMT
Hi, I need to somehow check the type of the weapon that is currently equipped melee or shooter. Is there something like the following pseudo-code: if (itemManager.currentEquippedWeaponType == Melee) (need to check item type, not ID) { do something... }
EDIT: Found it, no help needed
item.type == vItemType.Amulet
|
|