Hey, currently I use roblox’s built in physics engine however it can randomly begin to lag greatly causing the collector to stop collecting which further grows the problem.
I have seen around that I should “CFrame” my parts. How would I go about doing this as some parts fall from higher levels, how would I cframe that?
Is there a better way then CFraming? Yes I do set network owner.
I’d probably prefer CFraming the Parts, using TweenService especially.
My idea is to raycast downwards, find the position that it hits the conveyor at, calculate the Magnitude between the two and then minus the Part’s Size on the Y axis. Now you have where it should drop down to.
Ok, but I do want it to be smooth not a sudden drop, and how would I cframe it across the conveyor on the floor it starts on. (Im not GREAT with cframes.)
Smooth dropping can be achieved via TweenService and the ways you can customise it in the TweenInfo (Time, EasingStyle etc).
You get the Y axis from the method of finding where to drop down to, then you can easily create a tween which has the goal of setting it’s CFrame to the destination’s X and Z axis (with the Y axis filled in).
For that you may need to include a IntValue in the dropper which gives the number of the first Node to move to.
If you named the Nodes something like: Node1 (the end), Node2, Node3 then it’s possible to use a numerical for loop downwards:
local Nodes = --// Node Folder
local Dropper = --// Dropper
for i = Dropper.IntValue.Value, 1, -1 do
local CurrentNode = Nodes["Node" .. i]
--// Code
end