EntityGhostObject ControlDriver [SiO2]

Hello everyone!

If an EntityGhostObject has no parent object the getControlDriver() method will return null. Shouldn’t it return its own driver (super.getControlDriver())?

Probably. I guess I never considered ghosts being objects on their own.

Can we apply force and gravity to PhysicsGhostObject?

1 Like

I don’t remember. In my case, I used them as collision detectors.

What is your use-case for them?

Maybe @sgold know about it?

Me too, currently I am using them as a static collision detectors (trigger area/sensor) but In my game I am going to have ghost enemies that can fly through other objects. I belive I can not use a rigid body object for this(?) so I think I need to use ghost object and a ControlDriver to move them (by force?).

1 Like

I think I simply used an override on the collisiondetecter to check for some entity-data on the two objects colliding and find whether or not it should collide or not - this would allow you to set up your own collisiongroups. Perhaps the ghosts will at some point collide with something (ghostbusters, silver, magic) and your ghost object would no longer suffice.

1 Like

Its been too long since I was into it - so not sure if this is actually correct. I’ll just listen in on the convo :slight_smile:

You can’t apply forces or gravity to a ghost object: ghost objects don’t implement dynamics, and there’s no API for them to do so.

To move a ghost object, use setPhysicsLocation() or else replace it with a GhostControl.

Minie tutorial: Managing collisions :: The Minie project
Minie javadoc: PhysicsGhostObject (MinieLibrary API)

1 Like

@sgold thanks for clarification.

1 Like

For ghost enemies, you might want a rigid body with contact response disabled:

1 Like

Cool, thanks for the help, Stephen.

Is the contact-response flag checked in broadphase detection?

1 Like

Bullet is … complicated, but as far as I can tell, the contact-response flag doesn’t affect broadphase. Why do you ask?

1 Like

Just was curious :slightly_smiling_face: