I want to spawn a rocket to fly in a direction and explode on contact, dealing damage.
already have location and velocity for the entity.
My code at this point does not spawn any entity:
PHP Code:
new rockets=CreateEntityByName("prop_physics_multiplayer");
SetEntityModel(rockets, "models/weapons/w_models/w_rocket.mdl");
DispatchSpawn(rockets);
TeleportEntity(rockets, rocketpos, NULL_VECTOR, NULL_VECTOR);