Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Ho to make a tail or other bones to adapt to terrain

Discussion in 'Physics' started by Shadauwa, Nov 4, 2022.

  1. Shadauwa

    Shadauwa

    Joined:
    Jan 12, 2020
    Posts:
    16
    Hey everyone

    I have this lovely Larva (see attachment) but my problem is that its tail is not grounded as it normaly should.

    How can make it to apply physics on bones (rigging or coding) to adapt it on terrain ?

    Thanks in advance.
     

    Attached Files:

  2. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,663
    Applying physics is probably overkill, in this case I'd just raycast downwards from the position of each bone an displace it towards the terrain. That's much cheaper and gives you far greater control over the results.
     
    Shadauwa likes this.
  3. Shadauwa

    Shadauwa

    Joined:
    Jan 12, 2020
    Posts:
    16
    ]

    okay... hum any clues of how to do that ?
     
  4. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,663
    Raycasting is pretty basic stuff. Unless you’ve never written a single line of code before, looking at the documentation should probably help:
    https://docs.unity3d.com/ScriptReference/Physics.Raycast.html

    If you’re getting started making games and/or writing code, I’d suggest to follow basic coding tutorials first.

    Hope this helps a bit :)
     
  5. Shadauwa

    Shadauwa

    Joined:
    Jan 12, 2020
    Posts:
    16
    Thanks a lot
    I will looking i prefer to avoid coding but im not beginner on code so it will fine, i hopt, not a habbit to do C#

    raycasting from an object ok but for all need bones woaw seems a lot of work Oo
    I found this video but that's do not teach how to move each bones. dam :/
     
    Last edited: Nov 8, 2022