Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - 3D Lunatic

Pages: 1 [2]
PlayMaker Help / DO Tween Rigidbody 2D Rotate
« on: October 13, 2019, 01:58:49 PM »
Another pinball question, if you don't mind:

I'm using DO Tween Rigidbody 2D Rotate (Playmaker action) to rotate my flippers which have a rigid body 2D to hit the ball. I set my angle to a desirable value (30 degrees) but when the flippers rotate, they don't hit this value. They only go up to 20 degrees, and sometimes they don't return to 0 when I use the same tween to rotate them back.

I think the problem may be that I have to rotate them very fast. My duration is 0.05 seconds. I think this may be breaking the tween.

Is there another action I could use on a 2D rigidbody to rotate it like a pinball flipper? I just want to to rotate 30 degrees when the key is pressed, and then rotate back to 0 when released. Do I set up some kind of loop, incrementing the rotation by a degree for 30 updates (or physics updates), and then back? How can I set up the loop? I'm new to Playmaker. Any help is greatly appreciated.

PlayMaker Help / Pinball flipper problem [SOLVED]
« on: October 10, 2019, 11:34:18 AM »
I set up an FSM to control flippers in my pinball game. They work fine.
I'm rotating the flippers kinetically, using the DO Tween Rigidbody Rotate action, as I installed the DOTween PlayMaker actions. This allows me to rotate the flipper 30 degrees in 0.1 seconds, which looks right. I tried 0.2 seconds but it looked too slow.

The problem is when the flipper hits the ball, it flies way too far. I tried different methods to slow it down, but nothing seems to work well. When I put a lot of drag on the ball, it just looks sluggish. When I slow down the rotation speed of the flipper, it also looks slo-mo. I tried increasing the mass of the ball, but that makes no difference. In kinematic mode, the flipper has infinite mass and force, so the mass of the ball is irrelevant. I tried reducing the bounciness of the physics material on the flipper and the ball, but it doesn't affect how high the flipper hits it.

Is there anything I can do to reduce the energy of the flipper hitting the ball, or to limit the ball speed? Is there another action I should use instead of DO Tween Rigidbody Rotate? If I change the flipper to Dynamic, I can use the Hinge component to drive the flipper, and I can specify the maximum force. The problem is firstly that this is more costly in terms of processing than driving the flippers kinematically, and secondly it results in some undesirable behavior. I think the flippers should be kinematic. But how to limit the force with which they hit the ball?

Thanks in advance for constructive replies.

Pages: 1 [2]