Hi! I don't know what happened, but my Interaction HUD is acting weird. Any object that is lower than Camera is not visible by Interaction HUD - there is no way to interact with objects that are put lower than camera. Interaction works when object is on the same height as camera, but then something strange happends - Interaction HUD is ALWAYS visible when I'm looking under the object or above it.

My interaction Source is set to "Cursor". All colliders of the Interactable Objects are set correctly. I don't know what I did, but it's very annoying. If this doesn't work properly, I won't be able to add weapons lying on the ground to pick up or collect items from killed enemies.

I don't think I do any changes in ORK Framework. I was trying to load backups but either nothing has changed or I don't have a proper backup anymore.

Here is a video:



Please for help. I can't figure it out, I check propably everything that may cause this problem.
  • Hm, I've got 2 guesses here:

    1) Some other UI is blocking it.

    2) More likely, something on the player is blocking it - is the layer your player (or child objects of the player) also hit by the raycast?
    See the layer mask in Base/Control > Game Controls > Interaction Settings > Click Interactions.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I made sure the UI is not blocked. Still the same. The player has the "Character" layer, the weapon has the "Weapon" layer. I've already checked in "Click Interactions" - I have the "Default" layer set. I don't think it has anything to do with anything on the player.
  • I found what the problem was. I had two cameras - one was for rendering the world, the other one showed only the weapon (it's a FPP game, so it had to be this way so that the weapon didn't penetrate the walls). I was using Screen Space Camera for the UI in the ORK Framework because the UI looked very nice with the camera effects (bloom, etc). The weapon camera was tagged with "PlayerCamera" and the camera in the player's prefab had the tag "MainCamera". It turns out that was causing the problem. I was still trying to fix the cameras and it kind of worked when I tested the scene with ORK Game Starter, but when I started the game from the main menu the problem kept coming back. So I turned off Screen Space Camera and the problem is gone. As I mentioned - it's a pity it didn't work out as the camera effects gave my UI a nice look. But sometimes you have to lose something to gain something :) Thank you for help
  • edited February 2022
    Have you tried using a 3rd camera for the UI only?
    ORK will use the main camera for raycasting (e.g. to find the interactions).
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Yes, but the same is happening. Now that I've turned off Screen Space Camera, it all works fine. I guess if there was only one camera with a MainCamera tag, it would all work, but unfortunately I can't give up the WeaponCamera because the weapons cannot pass through walls. Thanks for trying to solve this.
  • Hm, I'll do some tests - can you give me more details on your camera setup for the different cameras and where they're placed/mounted?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • The player's prefab includes a camera with the tag "MainCamera", because I wanted to be able to animate the player's character with the movement of the camera, in addition, the camera script also requires the camera to be on the player. A camera with the tag "WeaponCamera" is on the scene. After the scene is loaded, I connect "WeaponCamera" to the player using Event. This is necessary because the ORK Framework needs to see the camera on the scene while the game is loading, as you explained to me in one of the comments.

    Now I have removed the "WeaponCamera" camera from the stage and added it right to the player, right next to the "MainCamera", so there are currently no cameras on the stage (which is fine if the Screen Space Camera is turned off).

    "WeaponCamera" is set to Depth Only and can only see the "UI" and "Weapon" layers.
    "MainCamera" is set to Skybox and can see all layers except "UI" and "Weapon".
  • edited February 2022
    I've got a suspicion on what's going on - since the main camera is spawning in later, ORK will find the only camera in the scene and use that, and it's not updated when the player spawns in.

    It'd be great if you can send me a small Unity test project where it happens on your end so that I can test my solution and make sure it's working for you :)
    Removing the Library folder from the Unity project's folder will greatly reduce the size, e.g. upload it somewhere (dropbox) and send me the link.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Or, try adding this component to your main camera (that's spawned later):

    using UnityEngine;
    using System.Collections.Generic;

    namespace ORKFramework.Behaviours
    {
    public class IsORKCamera : MonoBehaviour
    {
    public Camera cameraComponent;

    protected virtual void Reset()
    {
    this.cameraComponent = this.GetComponentInChildren<Camera>();
    }

    public virtual void SetCamera()
    {
    if(ORK.Initialized)
    {
    ORK.Game.Camera = this.cameraComponent;
    }
    }

    protected virtual void OnEnable()
    {
    this.SetCamera();
    }

    protected virtual void Start()
    {
    this.SetCamera();
    }
    }
    }
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • gamingislove said: Or, try adding this component to your main camera (that's spawned later):
    Oh my god, you are a life saver! Thank you very much! It's working now. Again, thank you :) Now my UI will look better :)
  • Will also be part of the next ORK udpate :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.