• 3D
  • Custom collision detection without move_and_slide

I am trying to make this plane (actually a rectangle box) hit my puck here (see link). My main problem is that the plane is driven by the mouse and I can't use the normal physics functions for a kinematicbody. The reason is that I want the crisp 1:1 movements with the plane and the mouse and "move_and_slide" just won't seem to cut it unless I am mistaken of course. With move_and_* either the stick is moving so fast that it jitters because continuously passes by the point I want it to be at, or I set a "close enough" value and the plane is jittery because the player moves the mouse too slow.

Right now the plane is the child of a pivot spatial that I am rotating to the mouse location. This makes the plane move and feel exactly how I want it but obviously the collision with the puck is almost non-existant.

I believe the solution is to detect when the puck and the stick collide and apply impulses on the puck based on how they are moving. However I can't seem to do that because with a kinematicbody I only get collision data from the move functions. I have tried a area but the body_entered signal does not give me any collision data either.

Image

Your image link is broken. I'm not familiar enough with that host or I'd try and fix it for you.

You could increase Physics Fps in the project settings to prevent some issues with tunneling.

I don't believe this is tunneling in the sense you are thinking. This problem is really occurring because all I am doing is calling the "look_at" function for the parent spatial on the plane. I believe this has the same affect as just manually moving the position of the paddle every frame. Thus the paddle not having any momentum or velocity for the puck to draw upon for it's reaction.

I guess my main problem here and what I am really trying to figure out. Is that I am stuck in the middle of two bad choices. Either I can have the paddle move how I want but not have any physics between the plane and the puck, or I can have sloppy puck movement with excellent physics.

I was hoping there would be a middle ground where I can at least manually provide my half of the equation for the puck to do its thing.

If you want to use the built-in physics, then move_and_slide is your best option. You should be able to get it close to 1:1 with proper velocity. It won't be perfect, but that will probably be easier than working with impulses directly.