3 questions in 1 topic (Please read its simple)

I wrote 3 Questions in the title So ill explain each one (I didnt want to spam the forum with questions)

  1. How do i detect wall/floor collision for destruction:
    i wanna detect when the player falls / gets launched onto a wall pretty much

  2. How do i keep the player from not rotating at high speeds -
    i have a roll system but the issue is if the player collides with a wall he falls
    i want him to stay stable and still if he does instead of falling or flinging

  3. rotating the player in the air while he is ragdolled:
    im trying to rotate the player in the air while he is ragdolled on a single axis
    Like a backflip i tried using bodyangularvelocity but it dosent seem to work (maybe i used it wrong)

2 Likes
  1. Raycasts
  2. Idk look it up theres posts on it
  3. Just use animations.
2 Likes
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")

humanoidRootPart.Touched:Connect(function(hit)
    if hit:IsA("Part") then
        -- detect if the player collides with a wall or floor
        print("collided with: " .. hit.Name)
        -- add your destruction logic here
    end
end)
local bodyGyro = Instance.new("BodyGyro")
bodyGyro.P = 3000  -- power of the gyroscope
bodyGyro.D = 500  -- damping of the gyroscope
bodyGyro.CFrame = humanoidRootPart.CFrame
bodyGyro.Parent = humanoidRootPart

-- disable the BodyGyro when not needed
humanoidRootPart.Touched:Connect(function(hit)
    if hit:IsA("Part") then
        bodyGyro:Destroy()
    end
end)
local bodyAngularVelocity = Instance.new("BodyAngularVelocity")
bodyAngularVelocity.AngularVelocity = Vector3.new(0, 5, 0)  -- example rotation
bodyAngularVelocity.MaxTorque = Vector3.new(0, math.huge, 0)  -- allow rotation around the Y axis
bodyAngularVelocity.P = 3000  -- power of the angular velocity
bodyAngularVelocity.Parent = humanoidRootPart

-- adjust the AngularVelocity for a backflip
bodyAngularVelocity.AngularVelocity = Vector3.new(5, 0, 0)

-- remove the BodyAngularVelocity when not needed
-- for example after a certain time or when the player lands
task.wait(2)  -- wait for 2 seconds (example)
bodyAngularVelocity:Destroy()
2 Likes

Hello, I recommend looking up some of these issues outside of the dev forum because these are more google questions than “I am stuck please help” questions.

The forum is more for if you have done all the research and are genuinely really confused or haulted on a step in the process of applying the information you’ve gathered.

Best wishes going forward!

1 Like

I am because the answers on google / other places dont really help and its really confusing for me because why does the angular velocity not rotate the player for example it dosent make sense

1 Like

body angular velocity is depreciated

angular velocity cant be used for this specific thing because of this

These are things that I googled. Btw, no magic, literally googled what you asked me.

for question one, when a player gets hit with a move you’d want to use raycasts to figure out the direction they’re going to determine when they’re going to hit a specific area or part.

for question two, you may be applying too much velocity to the player so when they do inevitably come into contact with a wall, it’ll apply that velocity and ragdoll them. you could either tone the velocity down if you’re setting velocity manually, or tweak the max power if you’re using a body mover. if both of those are out of the question, disable the HumanoidStates that cause ragdoll/rolling and it just simply won’t happen.

for question three, like @FroDev1002 said prior, you can do animations for this, BodyAngularVelocity which i know you said you tried, but its all trial and error until something works, or a BodyGyro to manually go through the angles of the rotation you want.

1 Like

not very helpful since it dosent encounter my issue but this post that i made helped me fix it i dont see the arguement here

Next step would to be mark whoever helped you fix it as the solution.

Also it answered the question you asked me, which is a step to solving one of the questions you had.

Google is an awesome resource, but you’ve fixed it already, so all you have to do now is give credit.

For the first part, the wording “launched” suggests that whatever happens when touching a wall will only happen if traveling at high speeds, so and humanoidRootPart.Velocity.Magnitude >= foo should be added to the if statement if that’s the case.

1 Like

True, thanks for correcting me