Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Any alternatives to CFrame? Furniture clipping through floor.

So, I am working on a sinking ship game and one of its features is having the furniture slide around when at a certain angle. Although, I have ran into a problem where the furniture will clip through the ground and It is really annoying. I am currently using CFrame and I know CFrame isn't the best for stuff like what I am explaining. I haven't got any errors, I'm simply looking for a resolution and suggestion to this problem as I want to make sure I am able to implement this feature as it will really add detail into the game.

1 comment

0

You can use Vector3 but CFrame would be your best option. You can use other stuff like GetTouchingParts for any clipping

1 answer

✓ Accepted answer

Hi I have a solution to your question!

So 1st you want to put all your furniture into a folder so you have them all in 1 place!

Then you probably want to an-anchor all the furniture once the ship is tilting so they slide off on their own.

You also want a set position of when to un-anchor the furniture

heres an example code:

local furfold = game.Workspace.Folder
local ship = game.Workspace.ship
local furchild = furfold:GetChildren()
local furnum = #furchild

if ship.Orientation == vector3.new(0,0,90) -- say the furniture will slide if the ship is tilted 90 degrees on the z axis.
	for i = 1, furnum do
		local furniture = furchild[i]
		furniture.Anchored = false
	end
end

Hope this helped!

Any questions? Just ask!

3 comments

0

Thanks, this helped a lot.

0

Sorry for such a late reply.

0

No problem, glad it helped! :)))

This discussion is preserved as it was. New answers, comments, and votes are closed.