Hi
I have a prefab that's acting as an item to be collected. I can make it work when the Item Collector on the prefab is set to Collision Enter but not when it's set to Interact. The prefab has a 2D Box Collider attached to it.
I have a player prefab who has a 2D Interaction Controller added to it. The player also has a 2D Box Collider assigned to it.
I've tried setting the 2D Interaction Controller on the player to be in the middle of the player, and also just in-front of him/her/it.
The Interaction Controller settings in Ork are set to "Add automatically" = Disabled. "Max Click Distance" is set to 3.
I'm interested in knowing where I've gone wrong as I'd just like to be able to walk up to an item and hit the Accept button (I've changed it to spacebar) to trigger the item being put into the inventory.
Olly
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I have a rigidbody 2D in place, and the interaction controller is a child of the player.
Here's a screenshot of my player properties.
https://drive.google.com/file/d/1NM4ssZZNOhq0Yrh3bvnUR3NwiH2-eIq9/view?usp=sharing
https://photos.app.goo.gl/5pEDzxfQT4xY3F68A
https://photos.app.goo.gl/59DacnKoJbXnhX3p8
In short - you can only interact with stuff that's within the Interaction Controller's trigger collider.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I've tried setting the trigger boxes on the colliders of both the collector of the item (the thing being collected), and the collider of the player.
See these.
https://photos.app.goo.gl/uuDCAJcsNaJW9ebe7
https://photos.app.goo.gl/XLTXjj4f9WHkepcM7
I'm not sure if this is important, but clearly I'm using a custom player controller for the player, and my script only looks at movement (up, down, etc). Should my controller be looking out for the spacebar (accept) and calling something in ORK or will ORK be handling that? I've set Accept to spacebar in the ORK settings.
Olly
Also, please post the the other added components as well :)
Interactions work if:
- your player has an Interaction Controller, a Collider (as trigger) and a Rigidbody (in your case in 2D versions) attached, either on a child object or directly on the root
- an interactable (i.e. start type Interact) game object is within the interaction controller's trigger and recognized by Unity's physics system (i.e. trigger enter)
Pressing the Interact Key will start an interaction of something within the interaction controller's trigger. If the inspector of the IC doesn't show anything interactable, the interaction is not being recognized by the physics system.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Will post some screenshot.
Certainly the IC is picking up the nearby interactions as the inspector shows one available nearby interaction. However even with this showing, hitting space and Enter doesn't do a thing (space being the specified interact key).
https://photos.app.goo.gl/Qzk5Pi47nTZ9uQHv9
Object to pick up
https://photos.app.goo.gl/vzW8nNJhjMx4PQzC7
https://photos.app.goo.gl/xoqLFWuDAxTdpxz19
Scene
https://photos.app.goo.gl/ENQHEBdeUZXMjc2P6
In game inspector for IC of player
https://photos.app.goo.gl/hZ36zhftzdjzygLv6
Could you send me a small Unity test project with your setup to contact@orkframework.com? E.g. upload it on dropbox and send me the link :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Will send you a google drive sharing link via PM.
Make sure your ORK game is running - either going through a main menu (starting a new game or loading a saved game) or using a Game Starter in your scene with Start Game enabled (see this how-to for details).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!