edited March 2018 in ORK Support
Hey,

So I have a top down game with ORK's mouse interaction and ORK's Navmesh Controller.
I want to have two types of interactions:
1) Player moves near event object, and event object activates.
2) Player can activate event object from a distance and does not move towards it.

I think I was able to achieve this by setting the click distance and move to interaction options. The problem is how to setup movement and navmesh layers.

So I have Ground unity layer and Interaction unity layer. if I set Movement to only work on ground layer, then when I click interactive object in the scene player will just run to the point where mouse clicks on ground layer, ignoring the collision of the interactive object.
If I set Movement to work on both Interactive and Ground layers, then half the time a move command is registered, half the time event is fired.

I also could not find the Layer mask for interactions. Does it use the one from Battle Selections settings?

Using latest ORK and Unity 2017.3.P3
Post edited by hellwalker on
  • I think NavMesh movement generally ignores colliders, you'd have to add a NavMesh obstacle component to objects that should be considered.

    Also, the Stop Distance setting for moving to interaction can be used to stop at whatever distance before the event object (also overridable for each event interaction).

    The interactions themself are currently not limited to a layermask.
    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!
  • Hi, I don't think navmesh itself is a problem. ( I tried it now and didn't solve the problem)

    Whats tricky is that I think when I click on interactive item, the interaction and movement get triggered at the same time.

    For example let's say I have a statue in the scene, on unity layer called interaction, that has Ork event interaction component with Click Distance set to -1, so it ignores click distance, and Move to Interaction set to false.

    This statue is placed on a plane, which is on unity layer called ground. and In ORK game controls Layer Mask is set to ground, so only ground layer can be clicked to move.

    So when I click the statue, because it is set on Interaction Layer, the mouse click movement Raycast goes through the statue and hits the ground plane behind or below it.

    Kind of like:
    image
    Where red line is raycast, the green X Statue Collider hit Raycast Hit point, and blue X the Movement Raycast hit point.


  • Oh, you're also using the Mouse player controls?

    If the started event doesn't block the player controls (and it doesn't use move to interaction), the player's movement will naturally just continue.
    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!
  • edited March 2018
    I added the block player control to event and sometime the event won't trigger anyway.
    This might be a bug with triggering the event after movement has finished?
    I recorded a video showing the event not triggering and my setup of event component/event/controls:

    and this is the navmesh around the chest:
    https://i.imgur.com/PJgFxgT.png

    Am I doing something wrong with setup?
    Post edited by hellwalker on
  • Hmmm ... think you can send me a small Unity test project where this happens?
    Would just need a scene with the chest and the player (and the ORK project), all other assets stripped :)
    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!
  • edited April 2018
    Sure, I have sent you a link in private message. It might take a few clicks and running back and forth until event does not trigger but it happens.
    Post edited by hellwalker on
  • Found the issue - your NavMesh agent's stop distance of 1 leads to the player stopping before being close enough to the destination to start the interaction (which has to be under 0.1 world units).

    To fix this, reduce the agent's stop distance (on the component). I'll also add a setting to change the minimum distance to the destination in ORK's settings.
    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.