Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Do I Put Max Limits on Dragging with Dragger Tool script?

Asked by 8 years ago

Can one of you please give me some ideas on how I can put a max limit on a dragger tool? The current dragger tools seem to let you drag an item out into the far reaches of space. I would like to put a limit of 50 studs away from the player's head and am having trouble figuring out a good solution for this. Any suggestions from those of you who have done this sort of thing, would be great. Thanks!

0
Magnitude :) Ryzox 220 — 8y
0
If it reaches a certain magnitude, how do I stop the dragger from dragging? JasonTheOwner 391 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Well I think I solved this myself - I ended up raycasting from the camera to the mouse target and then making sure the part found was a "KitchenCounter" part and also detected the Top Surface of the counter. If these conditions are met, then my mouse drag function drags the model to that mouse position.

I also created and invisble part called "KitchenCounter" and made it the whole width of the kitchen, so that items dragged could be dragged around the kitchen, and be seen, in case I wanted to drag it from a counter across the room, or to the trash basket.

The whole point is that Ray casting provided a decent, well performing solution.

Ad

Answer this question