So I am trying to get the drop setting of an interaction machine to work but I have been having no luck. I am using Unity 2021.3.1f1. Here are my settings:

image

image

I have a first person camera controller setup and the item drops from my inventory and lands on the collider just fine.
Here is the game object:

image

image

Any help would be much appreciated, thanks!
  • edited June 2022
    So I am trying a different approach to making a pressure plate that is activated when there is an object on top of it. So far what I have got is the following:

    image

    I have my dropped item tagged as an itemObject and am using the following schematic on trigger enter and exit of the pressure plate:

    image

    The basic logic is check if an itemObject triggered the pressure plate, if so negate the variable itemPlacedOnTop (setting it to true for the first time you put an item on top) then run the basic code for negating/setting the booleans that open the door in front of it when they are set to true.

    The only problem I am running into is that OnTriggerExit isn't called when I picked up the rock from the ground. Trigger enter works fine but not trigger exit, causing itemPlacedOnTop to never negate keeping the door always open even when you remove the item.

    Does this have something to do with mesh colliders in Unity or is this potentially a bug? I am writing this as I am still working on it. Just making an update to show where I am at.
    Post edited by Vanisle on
  • Ya looking into it I cannot get any OnTriggerExit function to fire from an interaction forwarder. OnTriggerEnter works fine but on trigger exit never gets called. Trying to get to the bottom of this.
  • Ok I fixed it. I didn't realize that by just deleting the object (picking it up) it would never leave the trigger and never cause trigger exit to activate. To fix this I added a simple schematic that moves the item into the air towards the center of the player so that the item leaves the trigger. Everything works now!
Sign In or Register to comment.