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

Is there a way to measure the pressure of an object upon another object?

As the titles says, it is possible to measure the pressure between an object and another object EX. A car crash.

2 comments

1

It's late, so if nobody has answered by the end of tomorrow then I'll share some thoughts on the matter on Friday. ;) My initial remark is that you don't need to bother with pressure, but rather just changes in momentum/forces applied/rate of change of velocity/impulses. i.e. You perhaps don't need to know about the relative sizes of surfaces and their 'pressure' exerted to achieve what you want.

0

Thanks :)

1 answer

Firstly I know I am a little late to the party here but I would like to share something quickly. Firstly I think accurately simulating a car crash in Roblox would be a pain, but I would go about it by first getting the mass of the two vehicles with:

function getMass(obj)
	if not obj then return 0 end
	if obj:IsA("BasePart") then
		return math.ceil(obj:GetMass())
	else
		local mass = 0
		for i, p in pairs(obj:GetChildren()) do
			mass = mass + getMass(p)
		end
		return mass	end
end

Then I would measure the two speeds of the car then use this to approximate force. How would simulate the results are beyond me and this is a simple solution as a more complex one would involve some very interesting math involving the surface size of the impact and materials involved and a whole host of other equations that I think is simply too in depth to be relevant to current roblox games.

1 comment

0

Lets say you already have the mass, how would you "approximate the force" witht the two speeds one a touched event? I was thinking of having sensors in the sides and front of the cars. If they also ram each other from side to side, how do I measure that force? (since it would be in a different direction, not forward.)

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