Collsion happening behind player... I tried to implement colission to remove this sort fo thing


#1

This is about the most annoying bug so far… Anyone have a good solution?
The problem:

Notice how the mesh isn’t aligned with the player? It’s a problem because players get killed from the back way too easily.


#2

If you align the mesh with the player, it will make it harder to kill the player from behind.

Also, if you tell us what the mesh is, what the player is, what is moving, what is being moved, what is killing, how is killing done, any thing else that would actually be useful, we could probably offer more helpful solutions.


#3

Yeah, seems like the problem is in the code we can’t see.


#4

I have two separate hull collision meshes. One for the spike, and one for the body. All updating is done in the update method of the main app state. The mesh appears to flicker between the correct positioning and where it was. The mesh only catches up to the player when it stops.
The player moves using setLocalTranslation and dies using a method that removes it from the node at the end of the game.
Both the body and spike nodes are attached to a parent node that is translated/rotated for movement.
It also may help to say that the physics objects are both ghost controls.


#5

Your code looks fine from here. (Hint: we can’t see it)

But 99.9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999% of the times stuff like this happens it’s because someone is moving the spatial manually instead of moving the physics object.


#6

Sounds about right. (BTW I’m away from my computer right now, so no code)
I didn’t realize you have to move the physics object when using ghost collisions. Thanks


#7

I mean, maybe that’s not i then. We’re going to be just giving you random guesses, playing 20 questions, until we have more information.

So I suppose we should wait to respond at all until you can put together a simple test case that illustrates the issue.


#8

Is the problem a fruit ?


#9

Well I figured it out. It’s that AABB thing with ghost controls that was the problem. I can’t figure out how to solve it though.

Tried: Collision listener, getOverlappingObjects and sweepTest


#10

So it’s not a fruit ? (that is not one of the 20 questions, just clarifying)

Does the problem have the concept of sexual preference ?