How to setup the physics for a breakout/pong paddle actor?

I want to have a moveable actor which should simulate physics, but has this kind of behavior:

  • can not be affected by any outside forces like gravity
  • can be moved by adding a impulse or setting the linear velocity directly
  • when collides with a body it should just stop (Never bounce, even if the physics material is set to restitution of one for the other static body)
  • does not rotate ever (Disabled angular motion)
  • when hit by other bodies it should just stay still (No Physics Response)

What must i set/do to achieve that behavior? Is that even possible?

The Behavior i am targeting is one of a paddle from a breakout like game!

Hi,

I would suggest using a kinematic actor. This will allow you to set position directly and will also take care of all of the requirements below. You won’t be able to set linear velocity or impulses, but these can be easily done by you using a blueprint. Just create a velocity variable which can be set in your blueprint. Then in the tick event update the object position based on the delta time and the desired velocity.

Ok i see, but what about the collision with static geometry? I already tried that, by modifying the position directly, but the actor was just passing through the static ones and had not collide at all… And what about disabling angular rotation?

If you use a kinematic actor it will not have any angular velocity so rotation is not an issue. For bouncing off static geometry I’d suggest setting the kinematic actor to overlap with static geometry and generate overlap events. You can then calculate the bounce manually. This is probably better for a breakout type game as you typically want to have the ball move left or right off the paddle based on things like player movement which are not physically correct.

You can also do various scene queries (sphere sweep for example) to determine where the ball will hit to determine what kind of action you should take