#Coding pinball flippers
1 messages · Page 1 of 1 (latest)
Can you tell us more about it @frosty eagle ?
yeah. what im trying to do is make a pinball system but im stuck working one the flippers
** You are now Level 4! **
i tried using tweens but that cause issues with collision.
heres the code for the left flipper
local input = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local flipper = game.Workspace.PINBALLFLIPPER1:WaitForChild("thing")
local motor = flipper.HingeConstraint
-- Settings
local tweeninfo = TweenInfo.new(0.1, Enum.EasingStyle.Quart, Enum.EasingDirection.Out)
-- Settings
local restAngle = 0
local flipAngle = -45 -- Adjust this based on your flipper's orientation
-- Store the original position and the "flipped" position
input.InputBegan:Connect(function(key, processed)
if processed then return end
if key.KeyCode == Enum.KeyCode.Q then
motor.TargetAngle = flipAngle
print(motor.TargetAngle)
--flipDown:Cancel() -- Stop moving down if we are pressing up
--flipUp:Play()
--if flipper.CFrame == flippedCFrame then
-- flipper.CFrame = originalCFrame
--end
end
end)
input.InputEnded:Connect(function(key, processed)
--if processed then return end
if key.KeyCode == Enum.KeyCode.Q then
motor.TargetAngle = restAngle
print(motor.TargetAngle)
end
end)
maybe just a for loop
or uh
use roblox physics
oh god
basicly
put a hinge on the spot where it turns
and give it velocity
and i wish you luck