Forum rules - please read before posting.

Player's hand position to cursor

Hi,

I'd like to set my player's hand to my cursor in near hotspot (near door with digital lock).

I put a digital lock near a security door, and I would like to set that my player hand (/hand bone) goes to my cursor position, because I want to imitate to push digital buttons near door. So when player goes there, I lock his movements and disable lock cursor, and after I would like to put this function, and player should move the cursor like your hand. So can somebody help me?

Thank you very much!

Comments

  • edited March 2019

    Be aware that you're looking to do something quite complex. You'll need a fair bit of custom scripting - and likely another asset if you want to get proper IK movement for the arm.

    Focusing on just the hand, however, you can override where the cursor is by defining an InputMousePositionDelegate. See the Manual's "Remapping inputs" chapter for more.

    An example of this delegate can be found with the provided "World Space Cursor Example" script. Place a Cube in the scene, and attach the script to it. You'll find that the cube follows the cursor, barring any collisions.

    Using this example as a starting point, you could adapt it so that the GameObject its attached to can only move a certain distance from its origin.

    At this point, you should continue to test with a Cube - or a separate hand model. Without a separate IK solution, you won't be able to move the character's Hand bone in this way.

    I'd recommend getting the script's behaviour the way you want it in a test scene - worry about getting it to only work at a specific point in the scene later. Once it's working the way you want, we can assist you with turning it on/off through Actions.

    As for getting the player's arm/hand to move with the dummy Cube, that's outside the scope of AC. You'll have to look for a third-party plugin or solution on the Unity forums for help with that.

  • Thank you Chris, I think I give up the my hand imagination, because I'm not developer.:)

    I thought that, I'll use a plastic hand to simulate it. I'll test it, and if there would be something, I'll write here.:))

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.