New Roblox In-Game CSG API is now available

You could use even less complex shapes without it being super noticeable by using a pyramid shape:

14 Likes

Oh my!

This is an excellent change. This is amazing!

Getting some pretty funky results when using UnionAsync to union more than two parts.
UnionAsyncOdditiesGif

Here’s a reproduction for anyone interested:
UnionAsync Oddities.rbxl (15.3 KB)

1 Like

This seems to be yielding a lot for me? I’m not sure if I’ve called it wrong, or too often, but it doesn’t do anything to the parts I specify and it doesn’t error; presumably it’s yielding as it doesn’t print what’s after the pcall. The same line of code worked earlier so I’m going to assume there’s some kind of rate limit that results in yielding or the error messages aren’t complete yet?

success, fault = pcall(function()
	print("Subtracting")
	newBase = baseplate:SubtractAsync({leftFoot, rightFoot})
	print("Subtracted")
end)

‘Subtracted’ doesn’t get outputted and the prints following the pcall don’t show.

This actually only seems to happen in play solo

I managed to make a really crappy, extremely laggy footprint thing. Can’t wait until this is clientsided and I can do this properly

function makeParts(parts)
	local createdParts = {}
	for i = 1, #parts do
		local newPart = Instance.new("Part")
		newPart.Size = parts[i].Size + Vector3.new(0,0.75,0)
		newPart.Position = parts[i].Position
		newPart.Color = parts[i].Color
		newPart.Anchored = true
		newPart.Name = parts[i].Name
		newPart.CanCollide = false
		createdParts[i] = newPart
	end
	return createdParts[1], createdParts[2]
end

function monitorMovement(char)
	local db = true
	repeat wait() until char:FindFirstChild("Humanoid") ~= nil
	char.Humanoid.Touched:Connect(function(part)
		if char.Humanoid.FloorMaterial ~= Enum.Material.Air and db then
			db = false
			spawn(function()
				wait(0.5)
				db = true
			end)
			spawn(function()
				print(char.Humanoid.FloorMaterial)
				local leftFoot, rightFoot = char:FindFirstChild("LeftFoot"), char:FindFirstChild("RightFoot")
				if leftFoot ~= nil and rightFoot ~= nil then
					local newPart,success,fault
					-- since meshparts aren't accepted, create parts to simulate the feet
					leftFoot, rightFoot = makeParts({leftFoot, rightFoot})
					-- do the editing
					success, fault = pcall(function()
						print("Subtracting", part:GetFullName(), leftFoot:GetFullName(), rightFoot:GetFullName())
						newPart = part:SubtractAsync({leftFoot, rightFoot}, Enum.CollisionFidelity.Hull)
						print("Subtracted")
					end)
					newPart.UsePartColor = false
					print("Worked ig")
					if success then
						print("Making new baseplate")
						newPart.Name = "AddedFootprint"
						newPart.Parent = game.Workspace
						wait(0.1)
						part:Destroy()
					else
						print("Something went wrong")
						print(fault)
					end
					-- remove created parts
					leftFoot:Destroy()
					rightFoot:Destroy()
				end
			end)
		end
	end)
end

game.Players.PlayerAdded:Connect(function(plr)
	repeat wait() until plr.Character ~= nil
	print("Character loaded")
	spawn(function() monitorMovement(plr.Character) end)
	plr.CharacterAdded:Connect(function(char)
		monitorMovement(char)
	end)
end)

Test it

cool


9 Likes

I was waiting for this update for a long time especially to do this!

https://i.gyazo.com/f4e25daf6632cfc43610ae26ff161676.mp4

23 Likes

Now make them cut along the direction you swiped your mouse :nail_care:

4 Likes

Youre on my point, how do i do that, any fast trick? :sweat_smile::yum:

Actually i did it!

https://i.gyazo.com/a7135d305e3a47d4fc72fbf7c8e7d0b8.mp4
Fixed
https://i.gyazo.com/c56183699927ef1ff434d073d5be0c0b.mp4

33 Likes

Any chance I can cut them all in a row?

Currently not, but i can modify it to work like that easily though

https://i.gyazo.com/d180555cd7539520cfa600578f57648b.mp4

Any game ideas for this? Fruit Ninja kinda game perhaps…?

9 Likes

yes please. do a noob ninja, where you have noobs that try to attack, and you can cut them in half, that would be really cool

16 Likes

lol sounds brutal

4 Likes

Actually amazing, I love your progress :blush:

2 Likes

Now Roblox needs to up or remove the triangle limit so stuff like this is possible. :stuck_out_tongue:

13 Likes

Can we be notified when live CSG will be able to work on Clients?

2 Likes

I would imagine quite a few of the things in that video use pre-made meshes for the destruction which are just put in place when the buildings etc are destroyed. I don’t think it’s really efficient in any game engine to have destruction that is 100% accurate, definitely a small increase in the triangle limit (maybe like 10-20k?) would be helpful though.

4 Likes

I would agree, especially the rubble after the building collapses.

However, I doubt the windows on the side of the building that come down are pre-made meshes as it always appear differently, at least to me. I might not be paying attention much to the windows.

1 Like

A post was merged into an existing topic: Off-topic and bump posts