As of recently, without any modifications to my script a new bug has appeared that has lead to some very strange interactions, not sure if there is much I can do to fix it, but I have tried many different methods, but all of them lead to the same issue.
Different methods I have tried is just the part itself, turning off collisions with the part and creating an invisible wall, various methods of looping for teleporting the part.
LocalScript is located in the StarterCharacterScripts
local runService = game:GetService("RunService")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
function CreatePart()
local part = Instance.new("Part", game.Workspace)
part.CanCollide = true
part.Anchored = true
part.Color = Color3.new(0,0,0)
part.Shape = Enum.PartType.Block
part.Material = Enum.Material.SmoothPlastic
return part
end
local pathWall = CreatePart()
local pathSize = 500
repeat
local pathX = humanoidRootPart.Position.X - humanoidRootPart.Position.X % pathSize + pathSize/2
local pathY = humanoidRootPart.Position.Y
local pathZ = math.clamp(humanoidRootPart.Position.Z, 6, math.huge)
local pathWallDistance = (humanoidRootPart.Position-pathWall.Position).Magnitude
pathWall.Position = Vector3.new(pathX, pathY, pathZ)
local viewingDistance = 16
pathWall.Transparency = pathWallDistance / viewingDistance
pathWall.Size = Vector3.new(2, viewingDistance-pathWallDistance, viewingDistance-pathWallDistance)
runService.RenderStepped:Wait()
until humanoid.Health <= 0
pathWall:Destroy()
Nothing looks wrong with the code. I noticed that you seemed to be able to walk through the wall after the character and the wall suddenly disappeared and reappeared. Are there any other factors at play?
Not that I can think of, what is also interesting is that I seem to also float above the terrain, if that has anything to do with it I don’t mind sending over the code that generates it
I figured out why the character was floating, it appears that there was an invisible baseplate that I forgot about, but it only makes it more strange as to why I had fallen through it, though after removing terrain it seems the issue is still present
After searching through every script in the game, the only modification is BreakJointsOnDeath where it has been set to false, though I have tried removing that before and the issue remained
The only questionable thing I see in the code given is using RenderStepped instead of Stepped, but I don’t think that would affect anything (though it might be worth trying to use a connection to RunService.Stepped instead of using a loop, and disconnecting on death). Are there any problems with collision with the baseplate now that terrain is removed?
Without the terrain I get the same issues, though I found after deleting the indication arrow the problem is solved, which is interesting to me because the indication arrow is not directly connected to the character.
This script is fine too, I think. Is the arrow model collidable? It may be causing the problem if so. Also, if the character’s body parts are placed in collision groups, make sure those are right. Apparently they can cause problems.
I wonder if this has anything to do with itemclipping (search it up if you don’t know). Even if the item is not collidable, if you equip and unequip it fast enough then you can clip through walls. I thought it was patched though.