Pinball collisions problems/advice

Hi everyone,

I’m new to unreal engine, and I’m learning how to build a game. So far I decided to build a pinball, very basic, just to learn how to import models, create class blueprint and pretty much basic things.

I manage most of things I needed, but, I get a really big problem using collisions in unreal.

I have that physic ball that is working pretty much as I want, my left and right triggers are correctly mapped to my controller, everything is colliding, but at a point the ball jump behind or go through my triggers, specially if I kick the ball quickly (let’s say 30 degres in half a frame). You can imagine it’s a big problem for a pinball game…

Could someone help me to figure it out, like having solutions for a perfect collider (I’ve tried custom meshes for collision, even with larger volume than needed).
Does unreal have any kind of substeps regarding the physic engin ?
How would you build this situation if you had to do a pinball game ?

Many thanks, and sorry if I’be posted my request in the wrong part of the forum.

.

if i understand right (not english speaker)
Check that if this its your problem
http://www.stencyl.com/help/view/continuous-collision-detection/

if its that, try activate CCD in your critical meshes like ball…

Anyway when i try few things i have problems with collisión when objects go too fast, CCD help alot but not good enough in some test.

Hope CCD help you.

Hi Knack,

Thanks for the quick reply, unfortunatly I’ve tried CCD and it does not fix the problem , it’s better but instead of blocking the ball, it push it in random direction (except the one I want of course …).

Any other technic I can use to push my ball with those triggers ? blueprint ? expressions ? clamping the speed rotation of my triggers ?

Thanks.

I’m having a similar problem with my air hockey game. It seems like I played around with every physics setting but the puck still passes though the flippers on occasion. Have you had any luck recently?

Hi Knack,

Have you tried turning sub-stepping on? (It’s a project setting under physics)

1 Like

I not remember, i think no, i try lots of things and finnaly i desist. Fortunately i could do otherwise. rethinking the issue and forgetting do things like this using UE.

One thing i try its example move a mesh(bucket) with other mesh with physics on, in. Using a physics handle for move the bucket like in one of the content examples, but always fall thoughts, especially if i move fast. CCD minimize but not fix.

i can disable physics and attach to a socket in the bucket but i want the posibility of fall with the movement of the buckets (not throught)

anyway thanks for the info if i need do something like that again before find an alternative i will try again.

my trys was months ago in the with 4.0

Substepping does help my game but unfortunately I am targeting mobile which I guess does not work? I am using CCD, clamping velocity, and set Max Physics Delta Time to 0.008889, while still getting around 52 FPS on Kindle Fire HDX.

Maybe disable the clamping velocity right after the ball or puck hits the flippers? Could that be it: The CCD is kicking in but its velocity is clamped so it doesn’t travel as far as it should in the next frame?

The ball or puck passing though the flippers doesn’t happen nearly as much on my desktop as it does on mobile even with substepping disabled. I’m not sure what that means. Desktop FPS is at 120.

You can’t just take a generic game physics engine like Unreal’s and expect it to reliably simulate something as delicate as a pinball machine without a lot of work. If it were that simple, we wouldn’t have studios that are pretty much dedicated to making pinball games.

The CCD will fix the ball passing through static objects, but you also need to deal with the fact that the flippers are **not **static objects: they rotate about a fixed axis. If you simply manipulate the flippers’ rotation every tick they will just “teleport” to a new rotation and it’s possible for the ball to get through them. You need the flippers to move with CCD and physical forces as well as the ball.

RyanGadz, Sub-stepping works with mobile since 4.2 released. I’ll have to take a closer look at this at some point to see if there’s any easy things we can do on the Unreal side

Oh good to know… yes that helps a little but still has problems hitting moving objects.

This was going to be my next attempt. In my original XNA code I used BEPU physics and it worked flawlessly after I changed the flippers from my rotation code to BEPU “motors.” I am sure it moves them in a more physical way than my “teleporting” at the moment.

So what is the best way to do this? Add PhysicsConstrainComponent to the pivot and then Add Torque?

Edit: After setting up physics forces for the flippers I realized I was still adding non-physics velocities to the puck. Taking off all clamping and velocity seems to have fixed the problem, although there is a lot of tricks that need to be done to prevent the puck from stopping in corners and slowing down to an unplayable speed.

Could you share your blueprint implementation or give some further advice on getting a physics based flipper implementation working using PhysicsConstraint?

Hey there I know this is an old thread but I’m havining similar issues. I’ve got the flipper thing solved but my ball will just move randomly while rolling or just suddenly stop moving all together for a slplit moment. CCD is inabled, I’ve tweeted the physics and the thing is it gets really bad after I do a lighting build which makes 0 sense.