Search Unity

Question Grounded spear movement from a point

Discussion in 'Physics' started by pitibonom, Jan 31, 2024.

  1. pitibonom

    pitibonom

    Joined:
    Aug 17, 2010
    Posts:
    220
    Hi all.

    Here's a lil pic:
    upload_2024-1-31_18-30-10.png
    A guard standing on ground. He has a spear ( in red ) in his hand. This guard is rigged and animated. What i need is to make the spear rotate around its articulation ( in blue circle ) accorfing to the guard's hand movement ( in green circle ).

    Mecanically speaking, it's just a rod aticulated on a ball joint and moved from its second anchor point.

    I thought U3D through physics and/or articulations could handle this very easily but i guess i'm too dumb for understanding anything in what U3D offers.

    1st i just don't see the interrest of articulations, instead of axis rotation of gameobjects hierarchy..... And above tyhis, articulations seem pretty voodoo tech with no simple and clear tutorials.
    If someone can gimme good tutorials about this, i'd be pleased to learn :D

    Beside this, and after trying many joints i thought the character joint was the vay to go for the point in blue circle. I tried the hinge joint but it appears unable to allow rotation around more than 1 axis.
    Unfortunately again, i'm just unable to make the spear rotate around the blue circle and following the point in the green circle...

    As a final word, the solution i found is to rotate the spear ( with the origin in blue circle ) by script with transform.Lookat but this asks for script execution and i'm pretty sure what i want to do is achievable through U3D physics.

    In sumup what i need is pretty simple: move a rod accordoing to 2 random points in space....
    Any help would be greatly appreciated :D

    Happy unitying ! :)
     
  2. pitibonom

    pitibonom

    Joined:
    Aug 17, 2010
    Posts:
    220
    bumpies ? :)