im trying to creat a ball type entity.
so far i have:
Code:
#include "cbase.h"
class CBallEntity : public CBaseAnimating
{
public:
DECLARE_CLASS( CBallEntity, CBaseAnimating );
DECLARE_DATADESC();
void Spawn( void );
void Precache( void );
};
LINK_ENTITY_TO_CLASS( info_ballentity, CBallEntity );
// Start of our data description for the class
BEGIN_DATADESC( CBallEntity )
END_DATADESC()
// Name of our entity's model
#define ENTITY_MODEL "models/roller.mdl"
//-----------------------------------------------------------------------------
// Purpose: Precache assets used by the entity
//-----------------------------------------------------------------------------
void CBallEntity::Precache( void )
{
PrecacheModel( ENTITY_MODEL );
}
//-----------------------------------------------------------------------------
// Purpose: Sets up the entity's initial state
//-----------------------------------------------------------------------------
void CBallEntity::Spawn( void )
{
BaseClass::Spawn();
Precache();
SetModel( ENTITY_MODEL );
SetSolid( SOLID_VPHYSICS );
SetMoveType( MOVETYPE_VPHYSICS );
SetNextThink( gpGlobals->curtime + 0.1f );
}
my ball is created but it doesnt move. i can left click with my grav gun. i see the weird ray thing but it has no effect on the ball
plz help