I have a script that detects when a player hits a part named “Wall,” then sticks them to that wall for a walljump. Usually this works, however randomly, it doesn’t.
https://gyazo.com/c19aed36cd44049c5c95d683dc57f0f0
The code I’m using to check if the .Touched event is firing is this. “wantsToWalljump” changes only when the player presses down and releases the space bar. Using this I narrowed the issue down to .Touched
not firing
Yes I know I could just use only the HumanoidRootPart, it’s just for testing.
character.HumanoidRootPart.Touched:Connect(function(touchedPart)
if touchedPart.Name == "Wall" and wantsToWalljump == true then
print("touched by "..character.HumanoidRootPart.Name)
end
end)
character.Head.Touched:Connect(function(touchedPart)
if touchedPart.Name == "Wall" and wantsToWalljump == true then
print("touched by " ..character.Head.Name)
end
end)
character['Right Arm'].Touched:Connect(function(touchedPart)
if touchedPart.Name == "Wall" and wantsToWalljump == true then
print("touched by "..character['Right Arm'].Name)
end
end)
character['Left Arm'].Touched:Connect(function(touchedPart)
if touchedPart.Name == "Wall" and wantsToWalljump == true then
print("touched by "..character['Left Arm'].Name)
end
end)
Is this a problem with my code, or is it a problem to do with Roblox itself? Is there a better method that’s simply lost on me?