Physexplosion Entity
Posted: Tue Apr 17, 2018 10:38 am
Hello guys,
sorry another Entity Create Topic.
Iam spawning a model with prop_physics_multiplayer.
On that spawned model (entity), i want to create an env_physexplosion entity which pushes in a certain radius every physic around.
My code so far:
So the models are spawned correctly, the entity.origin is valid. Everything is ok.
It just hasn't the effect i want. Iam not sure if i forget a property to set.
Can someone help?
PS reversing the spawn then setting start & explode doesnt help aswell:
Here is a link to the doc:
https://developer.valvesoftware.com/wik ... sexplosion
Thank you very much!
Cheers,
CANi
sorry another Entity Create Topic.
Iam spawning a model with prop_physics_multiplayer.
On that spawned model (entity), i want to create an env_physexplosion entity which pushes in a certain radius every physic around.
My code so far:
Syntax: Select all
def pushEntities(entities, magnitude, radius):
for entity in entities:
physExplosionEnt = Entity.create('env_physexplosion')
physExplosionEnt.origin = entity.origin
physExplosionEnt.damage = 0
physExplosionEnt.radius = radius
physExplosionEnt.magnitude = magnitude
physExplosionEnt.start = 1
physExplosionEnt.explode = 1
physExplosionEnt.spawn()
# Which are called like this:
spawnedModels = spawnModels(models, [Vector(deathOrigin[0] - 10, deathOrigin[1] - 10, deathOrigin[2])])
pushEntities(spawnedModels, 50000, 50000)
So the models are spawned correctly, the entity.origin is valid. Everything is ok.
It just hasn't the effect i want. Iam not sure if i forget a property to set.
Can someone help?
PS reversing the spawn then setting start & explode doesnt help aswell:
Syntax: Select all
physExplosionEnt.spawn()
physExplosionEnt.start = 1
physExplosionEnt.explode = 1
Here is a link to the doc:
https://developer.valvesoftware.com/wik ... sexplosion
Thank you very much!
Cheers,
CANi