How to change projectile speed in runtime

Hi,
I can modify the speed of AssaultRifleProjectile prefab using Inspector. But, How can I change it when the game is played?

Sorry, I don't know where the prefab object is linked to the scene.
 
You could create a new module that runs after the SpawnProjectile module. You'd use the ShootableProjectileData object to get a reference to the projectile and from there you can modify the velocity.
 
If you create a new module (or subclass the SpawnProjectile module) you can access it and then create any events that you'd like. There isn't a built in event that is sent.
 
Sorry, I tried several ways but it didn't work. I believe it is something related to the Pooling system. When the projectile is pooled, it's doesn't apply changes.

By the way, Is there any way to clear the pool?
 
You should apply the velocity change after the object is spawned so it's independent of the Object Pool. You can clear the pool with ObjectPool.DomainReset.
 
Top