Entity movement problem

I’ve made a simple entity:


AddCSLuaFile()

ENT.Base = "base_anim"

function ENT:Initialize()
	self:SetModel( "models/props_junk/cardboard_box001a.mdl" )

	self:SetCollisionGroup( COLLISION_GROUP_WORLD )
	self:CollisionRulesChanged()

	self:SetMoveType( MOVETYPE_VPHYSICS )
	self:SetSolid( SOLID_VPHYSICS )

	self:PhysicsInit( SOLID_VPHYSICS )
	self:GetPhysicsObject():Wake()
end

function ENT:SetPhysVelocity( vel )
	self:SetVelocity( vel )
	local phys = self:GetPhysicsObject()
	if IsValid( phys ) then
		phys:SetVelocity( vel )
	end
end

And i’m creating this entity whit following code:


local ent = ents.Create( "test_ent" )
		if IsValid( ent ) then
			ent:SetPos( self.Owner:GetPos() + self.Owner:GetAngles():Forward() * 50 + Vector( 0, 0, 50 ) )
			ent:Spawn()
			ent:Activate()
			ent:SetPhysVelocity( self.Owner:GetAngles():Forward() * 150 )
		end

And my problem is that when I spawn this entity, instead of entity that dynamic moves forward and down, I’m getting falling straight down entity which teleports forward 1 second after it touchs ground. What am I doing wrong?
Sorry if my English is bad.

99 percent of the time you’re not supposed to initialize physics on both CLIENT and SERVER. Make sure anything physics related in your code happens on the server only.

Thanks for response. Anyway after 2 hours i found why its happening. I was calling


SetPhysVelocity()

only serverside and when i called this on both sides everything worked.