Here is the steps to reproduce the bug:
- Create an actor (let’s say ActorX)
- Add a sphere collision as the root component
- Add a particle system under the sphere (root) component. (Attach a particle system as well. In my case, I used a particle system which has a mesh data)
- Create another actor (let’s say ActorY)
- In the BeginPlay function of the ActorY, spawn 25 ActorX and set their location where the player cannot see them. (Also save them in an array)
- When the player presses the left mouse button, fire a line trace function and save the hit location
- Set a spawned ActorX’s location as the hit location
- The location of the ActorX does not change
Here is the interesting part: if I add a static mesh component or a skeletal mesh component in ActorX, everything work perfectly. I can see the both the static mesh (or the skeletal mesh) and the particle system. Without any meshes, the actor’s location does not change or maybe the location is changed but the particle system does not follow the root component.
I simplified my problem here. What I am actually trying to do is creating an object pool. The object pool spawns 25 projectiles somewhere in the map, where the player cannot see them. When the player shoots the gun, I take a projectile from the pool and set its location, however, the projectile’s location does not change.