Search Unity

Attach an object (weld) on 2 points

Discussion in 'Scripting' started by Vancete, Apr 10, 2018.

  1. Vancete

    Vancete

    Joined:
    May 3, 2010
    Posts:
    198
    Hi there,

    I'm trying to figure out how to attach an object to a model based on 2 points, to be more specific, I have a rifle and I want to be fastened to both hands of the player model (like on Onwards VR).

    I was thinking on attach the first point by setting its position, then use LookAt to match the second point, but probably there's a better way.

    Thanks in advance.