Dropping an object from another?


I have an object in the First person player’s hand, how can I drop it? I parented the object to it so it does animate with the arm, but in the engine it moves a bit upwards, and the arm moves to the left. So it isn’t moving in the same way?

clear rotations and scale of the object, and replaced it in the right position.
use removeParent?

Right, I want the object to move with the arm, but I want to drop it in the engine, I hope that is what you understood?

I did manage to animate the object sperately so it does move with the other. I may have this task sorted. Just have to see. Of course that only animates it, that doesn’t move with the arm before dropping it.

The only way may be to have a arm load in while the one that drops the light object is removed.

if you mean you want a grab/drop weapon animation, that picks up an object at a specific frame of an action.
Then you need python. i am not going to guide you trough but i can point you in the direction.

you need python to read the animation frames, at that frame you can use python to pick up or drop objects.
basically what you need is:

action_layer = 1 #layer the animation is playing on
parent_frame = 30 #the frame of the animation where you want to pickup/drop objects

frame = armature.getActionFrame(action_layer)

if frame:
    if frame == parent_frame:
        #and here you parent or remove the parent

if this can be done with logic bricks i have no idea, look at the action actuator.

on frame zero parent the object that is rigid body to a object parented that is no collision parented to a bone.

parent it ghost not compound

on remove parent it should pop off and fall to the ground.

Nope, no weapon system or pickup, that can be done with the brick setup.

I’m referring to an object that the player holds and then just drops which then creates another event on the floor. Like water or fire.

Spawn in a dynamic object and make the static (animated) object invisible

sure you can. parent an empty on the main char, where the players hand is. create and set two handgun booleans (one for carried, one for used) at false at the players object. use near sensor or collision sensor when you run over the weapon set carried to true. make weapon invisble. when you use the weapon, copy the empties location and rotation to the weapon and make it visible. use parent actuator to parent the gun at the empty. if you want to use another weapon, make the gun invisible (send message). if you want to drop it, use parent actuator to unparent it.

Here are several options available too:

A) single item
As you mention one item is parented to the hand hook
remove the parent relationship on the fly

B) multiple items
This is good when the object that is in the hand has a different purpose than the released object

One item is parented to the hand (hand item).
On release you either hide or remove the hand item and you create a new interactive item. It may look exactly the same as the had-item but behaves differently (e.g. it drops to ground and measures collisions).
On collision the interactive item gets hidden/removed and you create a “ground item” or “explosion object” or whatever you want to achieve.

When the transitions between the objects fit together the audience will think it is a single object.

I used this method in my adventure. The objects are separated between:
-ground, hand, inventory, holder …

check the bag it turns from “ground” to “hand” to “worn”

check the arm, it turns from ground to hand to inventory (in bag)
check the torch, it turns from ground to hand to inventory (not in video) to holder and back to hand

I hope you get the idea.

So that is why you are Monster. Hilarious, the bag put on!:yes:

Right okay, from you’ve stated, and then Thatimster mentions a object, I duplicated the stick to drop, the other on the hand is joined and not parented as when I animated it with the hand, in the engine it didn’t move correctly.

So this duplicated object will need to then animate to the ground, once that occurs a new event needs to switch on, so a collision should activate that. As for the event, like a fire, that needs the cube of the fire to be where?

On the dynamic object that just falls once the engine begins, I replaced it with cube.001 it loads once it hits the ground, but it is a static grey box. The clip displays the problem, and I applied parent transform to the arm for the stick to remain and move with the arm. I did remove the animation from the stick as that wouldn’t work.

The only way I can seem to get anything staying in one place is to join it. So when I did the drop object, and it loaded a cube not quite the effect that should of loaded, an animated fire effect.

I think a copy of the stick I have that will drop on the floor goes in another layer, as to how to get the object to load at the same place where ever the FP is I don’t know. If I parent the object it won’t drop.