So i was on a track to learn how to apply bodythrust into raycasting suspension. For the entire day, i’ve been trying to make the part balance by applying force in four corners of the part using bodythrust but it seems to run crazily and fall out of the map when i try to do it.
Note:i think i should just use four parts in four corners of the main one and apply force into these parts but for now, i want to do what i just mentioned.
Here is the code:
local partposition = script.Parent.Position
local firstposition = partposition - script.Parent.Size/2
local firstcorner = script.Parent.firstcorner
firstcorner.Location = firstposition
local secondcorner = script.Parent.secondcorner
local secondposition = partposition - Vector3.new(-script.Parent.Size.X/2,script.Parent.Size.Y/2,script.Parent.Size.Z/2)
secondcorner.Location = secondposition
local thirdposition = partposition - Vector3.new(-script.Parent.Size.X/2,script.Parent.Size.Y/2,-script.Parent.Size.Z/2)
local thirdcorner = script.Parent.thirdcorner
thirdcorner.Location = thirdposition
local fourthcorner = script.Parent.fourthcorner
local fourthposition = partposition - Vector3.new(script.Parent.Size.X/2,script.Parent.Size.Y/2,-script.Parent.Size.Z/2)
fourthcorner.Location = fourthposition