#ball not bouncing off a wall
23 messages · Page 1 of 1 (latest)
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
if you do that it might not bounce correctly back
Okay so I've realised when I remove the attachment from the ball it does bounce but the ball system doesn't work
i've tried it
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)
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.
u sure???
** You are now Level 4! **
TRY THIS 1