Search Unity

Need help fixing my grab script

Discussion in 'Scripting' started by Jairusx, Jul 19, 2020.

  1. Jairusx

    Jairusx

    Joined:
    Jun 25, 2020
    Posts:
    62
    Hello guys! :) I have pretty simple grab item system that allows me to grab item, put it in slot and trigger event. But i need to make the script acting more stable.For example - when i grab an item, i need the item in the hand to stay still or freeze because otherwise it causes some weird glitches when item interact with rigidbody attached on FPS controller.
    Here is the glitches example -


    EDIT: I cannot post script because it is flagged for spam :(


    Many Thanks! :)
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    One possibility is to just crank up the damping setting of the Rigidbody on that object until it doesn't flap around so much...
     
    Jairusx likes this.
  3. Jairusx

    Jairusx

    Joined:
    Jun 25, 2020
    Posts:
    62
    I tried to increase mass on the rigidbody but it doesn't seems to help.Other problem is sometimes the item just goes underground.I really don't know why i cannot paste the code here.I know blind help without the script is hard. Thanks
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    Don't increase the mass, increase the damping, or
    .drag
    . Probably jack up the
    .angularDrag
    too.