How to use :Forward ?

I maked a mortar that fires shells and i was using a cone model, but i wasnt satisfied with the model then i switch to the headcrab canister model, but here comes the problems, with the cone the shell would go upward, but with the headcrab canister the same. And someone said me i should use :Forward but i don’t know how i should use it, then could someone help me out with this?

Mortar:



AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")



include("shared.lua")

function ENT:Initialize()
	self:SetModel("models/props_combine/headcrabcannister01a.mdl")
	self:PhysicsInit(SOLID_VPHYSICS)
	self:SetMoveType(MOVETYPE_VPHYSICS)
	self:SetSolid(SOLID_VPHYSICS)
	
	local phys = self:GetPhysicsObject()
	phys:Wake()
	phys:EnableMotion(true)

	
	self:SetMaterial("phoenix_storms/wire/pcb_blue.vtf")
	self:SetColor(Color(0,6,82))
	
	self:SetPos(self:GetPos() + Vector(0,0,60))
end

ENT.working = true

function ENT:Use(activator, caller)
	if(self.working == true) then
	self.working = false
	
	self:EmitSound("prepfire.wav", 70)
	
	timer.Simple(1, function()
		self:Shoot()
	end)
	

	self:EmitSound("   .wav" , 80)

	
	timer.Simple(4, function()
		self.working = true
		self:EmitSound("mortar_reload.wav" , 80)
	end)
	
	end
end


function ENT:Shoot()
	
self:FiringBoom()
	
	local ent = ents.Create( "mortar_simple_shell" )
	
	if(ent:IsValid()) then
	
	local phys = ent:GetPhysicsObject()
	

	ent:SetAngles(self:GetAngles())
	ent:SetOwner(self:GetOwner())
	ent:Spawn()
	self:EmitSound("mortar_whist.wav", 110)
	ent:SetPos(self:GetPos() + self:GetAngles():Up() * 50)
	end
end

function ENT:Touch( entity )
	local phys = self:GetPhysicsObject()
end

function ENT:PhysicsCollide( data, physobj )
	local phys = self:GetPhysicsObject()
end

function ENT:Think()
	local phys = self:GetPhysicsObject()
end

function ENT:FiringBoom()
local ent = ents.Create("env_explosion")
	ent:SetPos(self:GetPos())
	ent:SetOwner(self:GetOwner())
	ent:SetPhysicsAttacker( self )
	ent:Spawn()
	ent:SetKeyValue( "iMagnetude" , "1" )
	ent:Fire( "Explode" , 3 , 0 )
end


Shell:



AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")

include("shared.lua")

function ENT:Initialize()
	self:SetModel("models/props_phx/ball.mdl")
	self:PhysicsInit(SOLID_VPHYSICS)
	self:SetMoveType(MOVETYPE_VPHYSICS)
	self:SetSolid(SOLID_VPHYSICS)
	
	local phys = self:GetPhysicsObject()
	phys:Wake()
	phys:EnableMotion(true)
	
	phys:ApplyForceCenter(self:GetAngles():Up() * 30000000)
end

function ENT:Use(activator, caller)
	//Nothing
end

function ENT:Touch( entity )
	//Nothing
end

function ENT:PhysicsCollide( data, physobj )
	self:Boom()
end

function ENT:OnTakeDamage()
	//Nothing
end

function ENT:Boom()
	local phys = self:GetPhysicsObject()
	
	local ent = ents.Create( "env_explosion" )
	ent:SetPos( self:GetPos() )
	ent:SetOwner( self:GetOwner() )
	ent:SetPhysicsAttacker( self )
	ent:Spawn()
	ent:SetKeyValue( "iMagnitude", "120" )
	ent:Fire( "Explode", 60, 0 )
	
	ent:EmitSound( "mortar_explode.wav", 160)
	
	
	self:Remove()
end

function ENT:Think()
	//Nothing
end


Why make a new thread?

On topic, replace :Up by :Forward

Sorry, just made it to see how use it, i never used it anyway. Thanks :slight_smile:

Wiki is your friend.