You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
body following ur head but no noclipping thru walls
What is the issue? Include screenshots / videos if possible!
i noclip thru walls
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
disabling the part of the script, i did
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
this is the client part of the script
To prevent noclipping, you’ll likely need to add collision detection before updating the character’s position. Try using :MoveTo() instead of directly setting the CFrame, or integrate a raycast to check for walls and obstacles in the direction you’re moving. This way, you can stop the player from moving through solid objects while still following the VR headset’s position.
nope, that does not work, it just makes me move to that position infinitely cuz my camera is glued to humanoid root part, and moveto moves the hum root part
Since your camera is attached to the HumanoidRootPart, using MoveTo directly will keep the character moving indefinitely. Instead of MoveTo, you might want to update the position manually using a loop and interpolate the movement over time.
You can calculate the direction from the HumanoidRootPart to the target position and then use CFrame to adjust the character’s position while maintaining the correct orientation. Here’s a basic example:
local targetPosition = -- Your target position here
local speed = 10 -- Adjust speed as needed
RunService.Heartbeat:Connect(function()
local direction = (targetPosition - character.HumanoidRootPart.Position).unit
character.HumanoidRootPart.CFrame = CFrame.new(character.HumanoidRootPart.Position) * CFrame.lookAt(character.HumanoidRootPart.Position, targetPosition)
character.HumanoidRootPart.Position = character.HumanoidRootPart.Position + direction * speed * RunService.Heartbeat:Wait()
if (character.HumanoidRootPart.Position - targetPosition).magnitude < 0.1 then
-- Stop moving or perform any action needed
end
end)
This way, you can control the character’s movement without relying on MoveTo, allowing you to smoothly transition to the target position while properly orienting the character.