Heya,
So I’ve wanted to make a simple model builder that puts down a model and when the model is selected before putting it down, it follows the cursor for building help.
This would actually be straightforward for me if the model which is set (on move) to the player’s cursor position would not move up into nothing the entire time. I have set the TargetFilter already, so I don’t really see a reason why this should occur?
The issue is that you’re moving two different parts to the mouse’s cursor. The TargetFilter only works for one part, so it’ll ignore that part, but then you move a different part to the position of the first one, which will then be interfering with mouse.Hit.
The solution is to either put both parts/models (preMovePart and preCohort) into 1 single model and set the target filter to that, or you can use raycasting and put both instances into raycastParams.FilterDescendantInstances.
It will work as long as all the parts you’re trying to move are included in RaycastParams.FilterDescendantsInstances and RaycastParams.FilterType is set to Enum.RaycastFilterType.Exclude.
You are probably experiencing some issues with TargetFilter and whatnot. An easy solution you can apply is to set CanCollide and CanQuery to false for all parts in the model. This will ensure the game ignores the model when using Mouse.hit.