I have been trying to put my model's position on mouse, subtract some y axis because I want the attack to be underground a bit (its a lava geyser), but I cannot allign my lava geyser on the ground correctly, and the position is not making sense.
Local Script:
local rp = game:GetService("ReplicatedStorage")
local fire = rp:WaitForChild("firep")
local player = game:GetService("Players").LocalPlayer
local Mouse = player:GetMouse()
local debounce = false
local MousePosition = Mouse.Hit
print(multiplier)
if (MousePosition.Position - player.Character.HumanoidRootPart.Position).magnitude <= 63 then
if debounce == false then
debounce = true
fire:FireServer(multiplier, MousePosition.p)
end
end
Server Script:
local rp = game:GetService("ReplicatedStorage")
local event = rp:WaitForChild("firep")
local fire = game.ServerStorage.eruption
event.OnServerEvent:Connect(function(player, mp)
local humanoid = character:WaitForChild("Humanoid")
local humrp = character:WaitForChild("HumanoidRootPart")
fire.Parent = character
fire.PrimaryPart = fire.geyser
fire:MoveTo((fire.MeshPart.Position-Vector3.new(0,96,0)))
end)
I have no errors, my geyser spawns on where the mouse was, fire is the model with parts, BUT, when I try to make it lower by a little, it stayts ontop of the ground, but if I make it lowered by a bigger amount it goes way under the ground, and no matter the position I can't set it in the middle. I did calculations by subtracting it's position where it spawns minus the position where it's supposed to be, but it doesn't work. I don't know why this is happening, so is there any other ways to move the model or to fix this problem? Also, I know about SetPrimaryPartCFrame() but when I do it, my geyser is rotated weirdly, so how can I move the model without it rotating weridly in the mouse's position?
Lowered by a little(-50 on y axis): https://gyazo.com/0b0312cc4dea81321151f748dd175e80 It stays ontop the ground still, not even deeper by a little
Lowered by more(-90 on y axis or -80): https://gyazo.com/4babc67a89bd0e3a2761dde4131021d7

2 comments
is it cancollide? if it is make cancollide = false
why?