From your pooled projectile you can use a node “Get Projectile Movement Component”…
It’s there you change runtime values, if you change runtime values of a “Pooled Projectile” component at runtime it won’t work because it caches values to initialize the movement component of the projectile.
The “Pooled Projectile” component is a box for the default projectile component that cannot be pooled.
Hello there guys! Joining here the fun with me own issue, please see the video pool not working - YouTube
My projectiles for some reason sometimes work properly and sometimes don’t… sometimes they stop in place and disappear after a few seconds or disappear way too early (they are supposed to almost reach the edge of the screen)
Here’s my code pretty much, I’d like to believe I did it correctly but I am not sure, let me know if I am missing anything. https://gyazo.com/d903c68b55136077cb35e4de6b7dde27
https://gyazo.com/271bd4c3b879a3f1de79325b6edcdc8b
Thanks!
Anyway I managed to figure it out, I actually forgot to turn off gravity so the projectiles were colliding with floor and I was also using a “do once” node from my previous code, now it all works great! Love your plugin cheers
Hey, I’ve been using the object pooling component for a while now and not sure if it’s something specific to me but there’s an issue where OwningPool is always nullptr. There are places in PooledActor that seem to reference this but don’t check if there is a nullptr.
Also in the function USharedObjectPool::BeginDeferredSpawnFromPool in OBJPool.cpp this owning pool is always set to nullptr.
I’m not sure when this change was made, but not too long ago I didn’t have this issue. I’d say at least maybe 2 - 3 months ago.
OwningPool ptr should not be accessed from your code when outer is a SharedPool.
Instead of using GetOwningPool() you should as well use GetSharedPool() in that case.
I will add a patch to prevent a null access violation there.
However I’m not accessing Owning pool in any of my code at the moment, Blueprint or C++.
That exception is being triggered in PooledActor.cpp 119 where it’s doing the following check:
if (OwningPool->ReinitializeInstances)
Seems like there is an issue with the following logic which is supposed to prevent the function from performing the spawn at the beginning of the function.
if ((!OwningPool||!OwningPool->IsValidLowLevelFast())&&(!SharedPool||!SharedPool->IsValidLowLevelFast())) {
UE_LOG(LogTemp,Warning,TEXT("{Pool}:: %s"),TEXT("Actor trying to spawn from Pool, but Owning Pool Component is invalid!"));
return;}
Because I don’t see this warning message and breakpoints aren’t reaching here either
I think what you want to do is an OR if there is some logic that requires OwningPool to have a value? Or maybe a change so that OwningPool isn’t used and shared pool is used instead if there is no owning pool, as it seems to not be set for an pooled actor in a shared pool.
This is just from what I’m seeing. Sorry if overstepping any bounds or not understanding something.