How would I create a model or an effect at the angles of what I am looking at?
this effect is the same as the toolgun’s ghosting effect when making constraints, such as easy weld, axis, and so on.
Oh my god I made this exact same thread practically…
I was looking through the toolgun’s lua files, and i found some ghost entity code, but I do not understand it. This is in the Easy weld lua file, under TOOL:Think
if (self:NumObjects() == 1) then
self:UpdateGhostEntity()
else
if ( SERVER ) then
local Phys1 = self:GetPhys(1)
local LPos1, LPos2 = self:GetLocalPos(1), self:GetLocalPos(2)
local WPos1, WPos2 = self:GetPos(1), self:GetPos(2)
local cmd = self:GetOwner():GetCurrentCommand()
local degrees = cmd:GetMouseX() * 0.05
local angle = Phys1:RotateAroundAxis( axis , degrees )
Phys1:SetAngle( angle )
// Move so spots join up
local Norm2 = self:GetNormal(2)
local TargetPos = WPos2 + (Phys1:GetPos() - self:GetPos(1)) + (Norm2)
Phys1:SetPos( TargetPos )
Phys1:Wake()
end
end
I found some appropriate code:
http://www.facepunch.com/showthread.php?t=899002&highlight=hitpos+angles
If this works, my question was accidentally answered.