Hi, I am currently making a game like tower battle, I created the entrance, base’s health and moving enemies, now I move to the next step
What do you want to achieve? I want to make a placement system for my game ( place towers so they could defense the base)
What is the issue? I don’t know how to do it, I tried and it was very messy
What solutions have you tried so far? What I did so far is create a tower slot GUI and placeable areas (I group them in a folder) , I watched some tutorials from BOSS METRO but it didn’t work for me and I’m tired of rewriting script, I just want a more simple way to create the placement system
sorry for my bad grammar
you could use mouse.Move or use raycast to detect the mouse point and then you can place it but i think raycast is better as mouse.move makes it that you wont have limit for distance from player while raycast you can do limit
You can simply add magnitude check and I think you mean Mouse.Hit.Position rather than Mouse.Move although I wouldn’t recommend OP using old legacy mouse, I would rather recommend to use open sourced custom mouse modules (that are using raycasting and UIS anyways) or use raycasting as you said.
Yes you actually can because Mouse.Hit.Position will return Vector3 so you can do something like.
local Mag = (Mouse.Hit.Position - player.Character.HumanoidRootPart.Position).Magnitude
local Allowed = 30
if Mag < Allowed then
print("Allowed distance")
end