You are right! To prevent your character from bouncing, you need to change the physical properties of all collidable parts in your character (or all the parts that your character may bounce off, but this is not a good practice). The properties you need are Elasticity and ElasticityWeight.
Here is an example script showing how to do this (a simple dash implementation is also included):
local UserInputService = game:GetService('UserInputService')
--> Script should be located inside StarterCharacterScripts
local Character = script.Parent
local HumanoidRootPart: BasePart = Character:WaitForChild('HumanoidRootPart')
--> Create the custom physical properties
local physicalProperties = PhysicalProperties.new(
0.7, -- Default Density (Plastic)
0.5, -- Default Friction (Plastic)
0, -- Custom Elasticity
1, -- Default FrictionWeight (Plastic)
100 -- Custom ElasticityWeight
)
--> Declare and use the function to set the properties for every collidable BasePart inside the Character
local function SetPhysicalProperties(v: BasePart?)
if v:IsA('BasePart') and v.CanCollide then
v.CustomPhysicalProperties = physicalProperties
end
end
Character.DescendantAdded:Connect(SetPhysicalProperties)
for i,v in pairs(Character:GetDescendants()) do
SetPhysicalProperties(v)
end
--> Dash
local LastDash = 0
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E and not UserInputService:GetFocusedTextBox() then
-- Time check
local CurrentDash = tick()
if CurrentDash - LastDash < 5 then
return
end
LastDash = CurrentDash
-- Multiplication of the horizontal linear velocity
HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(HumanoidRootPart.AssemblyLinearVelocity.X * 10, HumanoidRootPart.AssemblyLinearVelocity.Y, HumanoidRootPart.AssemblyLinearVelocity.Z * 10)
end
end)
That fixed the bounce off issue, I’m going to implement it to my script! However, the wedge problem persists, but I’m pretty sure I know how to fix that, preventing the humanoid from tripping should fix it.
(Oh yeah forgot to mention too that I have a StarterCharacter so I’m guessing changing the physical properties is not needed to be executed via script and it can be just executed manually)
If I don’t have any more problems with this later, I’m marking your post as the solution.