LIVE - Upcoming Physical Properties and PartMaterial Changes

This also crashes on Production.

What is the point of this script?

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		local arm = character:WaitForChild("Right Arm")
		
		local part = Instance.new("Part")
		part.CanCollide = false
		
		for i=1,500 do
			local partB = part:clone()
			partB.Parent = part
			local weld = Instance.new("Weld", partB)
			weld.Part0 = part
			weld.Part1 = partB
		end
		
		local handWeld = Instance.new("Weld", part)
		handWeld.C0 = CFrame.new(0,0,-10)
		handWeld.Part0 = arm
		handWeld.Part1 = part
	end)
end)

To create a large mass attached to the player. Oops – if it crashes on production, it’s probably studio not being able to create 1000 instances back-to-back. I better lower that number.

Did this file ever used to work before?

No – I just didn’t notice that creating that many instances would be a problem at glance.

I mean it really shouldn’t. I’m getting a memory allocation failure from it. I’ll take a look at this separately. Let me know if you can test the feature on GT1.

1 Like

I was able to get into play solo by lowering the amount of parts to 10. Even lowering it 100 froze studio, so thanks for looking into this.

Setting part density to 1/math.huge should give them negligible mass, right? I did that to the 11 parts attached to my character and they still affected my CoM and even caused me to fly off the map:
https://drive.google.com/file/d/0B7daNr0GZMLyTFpuYXYwTXdzbVE/preview

code:

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        local arm = character:WaitForChild("Right Arm")
        
        local part = Instance.new("Part")
        part.CanCollide = false
        part.CustomPhysicalProperties = PhysicalProperties.new(1/math.huge, 0, 0, 0, 0)
        
        for i=1,10 do
            local partB = part:clone()
            partB.Parent = part
            local weld = Instance.new("Weld", partB)
            weld.Part0 = part
            weld.Part1 = partB
            weld.C0 = CFrame.new(0,0,(i-1)*-2)
        end
        
        part.Parent = character
        local handWeld = Instance.new("Weld", part)
        handWeld.C0 = CFrame.new(0,0,-10)
        handWeld.Part0 = arm
        handWeld.Part1 = part
    end)
end)

I’ll try this out

Minimum density value is 0.01.

Oh, alright. Shouldn’t 0.01 density prevent me from getting flung off the map though? Each of those parts should have a volume of 8 studs^3, for a total of 88 studs^3 – with mass=pv, mass=0.0188, the mass should be 0.88 which is negligible. < 1 part’s mass (8) shouldn’t fling me off of the map / mess up my CoM much, right? But in this case that much mass is doing that.

You’re saying that this flung you off the map? Strange, I’m trying it on a local build and it seems fine.

Yes, I was flung off the map. There’s a video in this post that shows that if you haven’t seen it yet. Try jumping around like a maniac – that will make it much more likely to happen.

Also, it looks like the default mass with the new physical properties is 5.6 and not 8, but 0.88 is still less than 1 of those parts which wouldn’t fling me off the map.

Edit: PGS was enabled if that makes a difference

Yeah, I’ve not been able to repro the fling yet. I saw your video, looks strange (I do have PGS on)

Which version of Studio are you using? The exact one that has been pushed out to GT1 or a more recent copy only available at the office? I’m currently using version 0. 221. 0. 66092. I’ve been able to fling myself within seconds every time by holding down the spacebar and then using WASD to turn in circles.

And here’s the place file so you can make sure all of the level settings are the same as what I’m using, even though I only remember enabling PGS and that was it:
Crashes.rbxl (10.7 KB)

Separate feature request, but when this feature gets shipped, can we get density of hats to be set to 0.1 so that swimming in water isn’t negatively affected by having hats equipped? Right now you just sink unless you manually resize hats.

Unfortunately, a lot of games don’t do this.

2 Likes

It seems as if @EchoReaper has CanCollide true, while @Khanovich has it false.
On Khanovich’s gif you see that the part goes trough the baseplate a lot.
If CanCollide is true, wouldn’t that lead to some weird results, as the end of the long part hits the ground?

CanCollide was false on my parts as well.

Didn’t seem like it…

I attached two place files and source code – all of them set the parts to CanCollide=false

Your script increases the hierarchy being cloned 2x on every iteration of the loop - so for N iterations you spawn O(2^N) parts. We can’t handle 2^500 parts yet :frowning:

2 Likes

Oooohhhh – right. Oops. I’m also cloning all of the clones that have been parented to that part, so the total mass (with the density set to 0.1) is 819.2 which is around 146 4x1x2 parts of normal density. Didn’t see that. 146 parts moving the CoM of the character forward so much could certainly cause the character to fling.