Also, while we are at it, would this be a correct setup: Gun has Pool component, projectile that is spawned by the gun will be a Pool Actor, but also will have a Pool Component that will spawn particle effects and sounds when projectile hits something (which are also going to be Pool Actors) ?
I am a bit lost here… So Pool Component should only be in the gun actor (or pretty much anywhere in the game as long as I pass the pool component into any other actor that spawns pooled actors, via BPI for example) ?
Yes, you can set the transform of the actor spawned from pool, so there’s no need to have pool components attached to pooled actors.
Pooled Actor classes also have blueprint interface events fired when they spawn or return to pool.
If you are not paying attention, you have PoolComponentA spawning PooledActorA… then you add PoolComponentA as a component to PooledActorA what happens is you are going to cause an infinite cycle of PooledActorA spawning and possibly a crash. So it’s not recommended to deal with that unless you are certain you won’t do that kind of mistake.
Also you can attach common actors to pooled actors as children, that cause no issue.
OH MY GOD - I can’t believe all we had to do was specify the Pooled Class before connecting the Object Pool. I reinstalled the engine twice just because of this bug - not being able to simply drag off of an Object Pool component and Spawn Actor From Pool.
Mind numbing.
[USER=“434”] XaVIeR[/USER] I finally upgraded to 4.25.1 and I am still getting this in the Output Log window when packaging my project (with Object Pool plugin) for Android:
I am using source build of UE4, not the launcher version and the only place where Object Plugin is located is in my project.
That is harmless. I kept that log there for longer than it should, I used it to track some debug points in a large pile of logs on big project, but it actually means nothing to worry about.
A developer is having trouble working with Homing Projectile setup, so I will try to explain the basics here (in case anybody else is confused by this as well), where his efforts are going wrong.
First, do not try to force a target long after the projectile was spawned; create a Target property and make it editable with ‘Expose on Spawn’ enabled:
Second, make use of ‘Pool Begin Play’ event from your pooled actor BP that you use as class for your projectile. Pass the default Target value to the Pooled Projectile component:
Then on your spawner Actor (the one that owns your Object Pool Component), don’t forget to find your actual Target actor in world and attach it to your new pin;
Also very important: do NOT enable gravity and/or Physics simulation on your spawn options, if that is enabled Homing effect won’t work as expected:
[HR][/HR]
If done it right, you should have perfectly fine pooled homing projectiles, like these:
>"First, do not try to force a target long after the projectile was spawned"
So, a missile can’t change target after its launch? (you know, change target because the one you choice at start, is suddenly destroyed by anything else.) Right?
Yes it can, what won’t work is not having ANY target set from Pool Begin Play event. You have to pass the value to the projectile component from that event at least once.
I updated to UE 4.25.2.
I migrated OBJPoolDemo from UE4.24 to UE 4.25.2
When I pack a project, it show this error. It seems objects pool plug-in is not compatible with UE4.25.2. Please update the plug-in.
Ran into an odd problem today: My missiles (Homing Projectiles) work fine, but if I want to make torpedos that fly straight for say 2 seconds THEN begin homing, I simply cannot get it to work. I’ve tried using every type of delay node to set a new Homing_Acceleration_Magnitude float or Is_Homing_Projectile bool to true but nothing I seem to do allows for a torpedo homing projectile…
Really the simplest solution I can think of is to set Homing_Target Actor, Is_Homing_Projectile ---- but leave Homing_Acceleration_Magnitude float at 0 then after a 2 second delay change the Homing_Acceleration_Magnitude to say 7000, but nothing I am doing works.
halp