Hi guys.
I think everyone knows how to make conveyor at roblox: Create anchored part and add velocity to it, and everything what will get on it will be moved.
But how I can do unanchored conveyor? Velocity will just affect itself, and not push things ontop of it.
just asking why would u want a conveyor that doesnt push objects, also can u explain more on unanchored conveyor
I don’t need not working conveyor. I want to make it unanchored. Like I have a model of conveyor, which initially anchored, but when game destroys it (by setting health variable to 0), conveyor prop will unanchor, but still should operate.
You got 2 options:
-
Use touched events to detect parts touching the conveyor then apply velocity to the parts in the direction of the look vector of the conveyor (you can add velocity with Impulses)
-
Do a spatial check around the conveyor and then add a LinearVelocity to the parts within the bounds of the said spatial check, Remove for parts that are outside of it.
A thing id like to mention is that Touched events are not accurate at all and even though they are Easy to use they are SUPER BAD. A better alternative that is a bit more computionally expensive is Raycasting. Just cast a ray from the Postition of the parts you want to move towards the ground (-Vector.yAxis / Vector.new(0,-1,0) first is better tho as it doesnt create a new vector)
Then just apply velocity to the parts that are in contact with the conveyor.
To check parts near conveyor I can use workspace:GetPartBoundsInBox()
, I were struggling with moving aspect of conveyor.
I’ll try what you suggested.
If you want i can provide you with an bare bones example code.