Making a Dynamic Object a Ghost without making it static?

Hello!

Is there a way to make a Dynamic Object a Ghost without making it static?

Edit:
“make a Dynamic Object a Ghost without making it static” in Python while in Game :stuck_out_tongue:

Kind of Solved with CollisionGroup and CollisionMask, there seems to be no way to just do that with one command

Yeah just do that:

Think he or she means in game ,

one way to do this is to spawn a ghost copy from a hidden layer, transfer properties and delete original

with agents with armatures / actions its a bit more difficult,

you must change frame while item is invisible and have it become visible/ delete the original after it matches pose

Maybe upbge has a switch for this?

If it is in-game, then instead of making it static you can change the collision layer and collision masks of the object., which does something very similar (makes collisions between two objects not happen).

@Nicholas_A: wow thanks :DDD
jk i meant in game :stuck_out_tongue:

because:


#1. Attempt: Object is Dynamic (= actor, is not ghost) in Editor
owner.suspendDynamics(True) #would make it ghost, but suspends Dynamics

#2. Attempt: Object is Dynamic (= actor, is not ghost) in Editor
owner.suspendDynamics(True) #is ghost
owner.restoreDynamics() #is not ghost anymore

#3. Attempt: Object is Dynamic + Ghost in Editor
owner.restoreDynamics() #doesnt remove ghost - still is ghost.


@BPR
ok i could do that, but isnt that performance heavy? (would need to do that with something that happens regularly)

@sdgeoff
yeah i know about Collision Groups/Mask, but i think need the object to still detect collisions with other objects.
Ok i need time to think about it. (I think there is a way that i didnt think about before) - yes i thought of a solution which should solve my issues :stuck_out_tongue:

Isn’t that physics type: sensor

@Monster

well… yes. but i do actually use a parent thats dynamic, and a sensor that detects collision, and i use that for all my spells.

And in one spell something has to lie on the ground (collide with the ground), so i cant only use a sensor.

Now my solution is that for this one spell that should collide with the sensor, i change the Collision Group that it can collide with the ground.

For the other spells i have the Collision Group so that the parent doesnt collide with the ground, but the sensor detects it.

in python, you could raycast to the ground and set the location at the hit point and orientation by the normal.