#Sittable bouncing ball

1 messages · Page 1 of 1 (latest)

grim condor
hardy trench
grim condor
#

hm let me try

hardy trench
grim condor
#

i did it like this: `local TweenService = game:GetService("TweenService")
local ball = script.Parent
local seat = ball:FindFirstChildWhichIsA("Seat")

local originalSize = Vector3.new(4, 4, 4)
local squishSize = Vector3.new(4.4, 3.4, 4.4)

local bounceTween = nil

-- Tween info
local tweenInfo = TweenInfo.new(
0.3,
Enum.EasingStyle.Sine,
Enum.EasingDirection.InOut,
-1, -- loop forever
true -- reverse
)

-- Create the tween function
local function startBounce()
local goal = { Size = squishSize }
bounceTween = TweenService:Create(ball, tweenInfo, goal)
bounceTween:Play()
end

local function stopBounce()
if bounceTween then
bounceTween:Cancel()
ball.Size = originalSize
end
end

-- Detect when player sits
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if seat.Occupant then
startBounce()
else
stopBounce()
end
end)
`

hardy trench
grim condor
#

uhm its part

#

ball shaped

hardy trench
#

let me quickly run a very quick test

#

Nope, I would just use a mesh

#

Wanted to check if roblox had some property for it. But for some reason their balls suck

#

Just an isosphere and some subd. Should be smooth enough

#

In case it isn't, then I can send you a smoother one (the smoother it is, the laggier it is, of course)

grim condor
hardy trench
#

While a mesh, there it just allows you to deform it as you wish

grim condor
#

model u sent me, is it mesh?

hardy trench
#

Yes, .objs are almost always meshes

#

Example of what I meant: With a mesh I can do this

grim condor
#

it looks so good

hardy trench
#

With a ball, it would just try to fit the same "truck", just scaled down to be the largest it can be inside that shape

grim condor
#

do i have to anchor mesh

#

ig yes

grim condor
#

it looked so easy at first 😭

hardy trench
#

But you could just anchor it

#

Do remember that it then will be floating

#

so move it down half the size change in the y position

#

(at the same speed as the size change)

grim condor
#

i mean it still doesn't bounc

#

do u want script?

hardy trench
#

Have you added the force that I told you to add?

grim condor
#

Oh- I didn’t

grim condor
trail rover
#

Use a mesh and bone to animate it squishing

grim condor
trail rover
#

idk, ask chatgpt