#ball not bouncing off a wall

23 messages · Page 1 of 1 (latest)

proven flicker
#

So basically I made a similar ball system to TPS: Street Soccer and it works but whenever the ball hits the wall, goal post or crossbar it just starts rolling down and doesn't actually bounce off.

split plinth
#

i believe something along the lines of negative velocity

#

no

#

like invert velocity in one direction and idk bout the other

#

ik how to do it relatively but

analog vigil
proven flicker
modest dagger
#

Ask chatGPT

#

:DDD

proven flicker
#

i've tried it

modest dagger
#

ill make a script rq

#

ill try

#

You can create a simple Roblox Studio script using Lua to make a part bounce when it touches another part. Here's an example script that you can use:

#

-- Variables
local partToBounce = script.Parent -- Change this to the part you want to bounce
local bounceForce = Vector3.new(0, 100, 0) -- Adjust the force as needed

-- Function to handle collisions
local function onTouch(hit)
if hit:IsA("Part") then
-- Apply the bounce force to the part
partToBounce.Velocity = bounceForce
end
end

-- Connect the onTouch function to the Touched event of the part
partToBounce.Touched:Connect(onTouch)

proven flicker
#

he's already

#

given me

#

that

modest dagger
#

Here's how to use the script:

Open Roblox Studio.
Insert a part into the workspace.
Insert a Script into the part.
Copy and paste the script above into the Script.
Make sure to change the partToBounce variable to the part you want to bounce. Adjust the bounceForce vector to control the direction and magnitude of the bounce force.

This script listens for the Touched event of the specified part and applies the bounce force when it detects a collision with another part. Note that you might need to adjust the values based on your specific requirements and the scale of your game.

modest dagger
gusty hamletBOT
#

studio** You are now Level 4! **studio

proven flicker
#

same exact one

modest dagger