Forum rules - please read before posting.

Trying to carry object around scene.

I am trying to have a character pick a baby off the ground and carry it throughout a scene. I found this tutorial called physics demo, but the link doesn't work? Is there a way to get to the tutorial?

How do I achieve my goal in general?

https://www.adventurecreator.org/files/AC_PhysicsDemo.unitypackage

Comments

  • The updated link to the old Physics demo can be found on the Downloads page. It is outdated, however.

    The First Person primer tutorial covers AC's PickUp component, which allows for the dragging of objects around, here.

  • Well, what I want to do is have an NPC carry the baby in 3rd person like this:

    It's not first person.

  • There's no physics involved in this approach - you can just parent the object to the character's hand, and animate the hands with a sub-layer in the Animator.

    Once "hand transform" bones are assigned in the character's Inspector, you can use the Character: Hold object Action to have a character carry an object. This is covered as part of the 3D Primer tutorial here.

  • A couple of problems happen.

    1. What I want the NPC to hold is the active player (which is a prefab). When I put the player's prefab in the "hold object" field, a new baby pops up instead. How do I have him pick up the current baby already spawned in the scene?

    2. Do I have to play the "picked up" animation at the same time he holds the object? Otherwise, the baby is playing the idle animation when he spawns in his hand.

  • edited September 2022

    Alright, so ignoring the duplicate baby problem ( I am just going to momentarily teleport active baby) , I got it to where the baby attaches to the chest when picked up by the right hand. However, now he is stuck in the NPC's head.

    Is there a way to offset how the object is held so he is in front of his body? I don't understand how to do that in the animator.

  • Do I have to play the "picked up" animation at the same time he holds the object? Otherwise, the baby is playing the idle animation when he spawns in his hand.

    Create and assign a separate baby prefab to be picked up, without the Player component, and use a separate Animator asset that plays a "picked up" animation by default.

    Is there a way to offset how the object is held so he is in front of his body? I don't understand how to do that in the animator.

    The baby should become attached to the NPC's hand - or whichever bone you assign in the NPC's "Hand Transform" Inspector fields. This doesn't necessarily need to be his hand, however - you could assign an empty GameObject in the NPC's Hierarchy that you can then reposition as necessary.

  • It doesn't seem to work

  • Remove any Rigidbody/Collider components on the baby prefab variant that's being picked up - they'll cause issues with parenting otherwise.

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.