@LatFoued I’d suggest you take a look at your Blueprint Graphs and make sure you don’t have “Spawn from Pool” nodes with unlinked Pool pins as well.
If you believe there’s something wrong with this warning, you can double-check the code.
This warning comes from this file:
K2Node_SpawnActorFromPool.cpp:
const TArray<UEdGraphPin*>* PinsToSearch = InPinsToSearch ? InPinsToSearch : &Pins;
//
UEdGraphPin* PoolPin = GetPoolPin(PinsToSearch);
UClass* SpawnClass = nullptr;
//
if (PoolPin && (PoolPin->LinkedTo.Num()>0)) {
auto LinkedPin = PoolPin->LinkedTo[0];
UClass* PoolClass = (LinkedPin) ? Cast<UClass>(LinkedPin->PinType.PinSubCategoryObject.Get()) : nullptr;
UObjectPool* PoolComponent = Cast<UObjectPool>(PoolClass->ClassDefaultObject);
if (PoolComponent) {
SpawnClass = PoolComponent->TemplateClass;
} else {
UE_LOG(LogTemp,Warning,TEXT("{Pool}:: %s"),TEXT("Trying to Parse Object-Pool Component, but Pool Component is Invalid!"));
}
} return SpawnClass;
You can see there the errors shows up because for some reason your Pool Component came out as a nullptr.
Maybe this node is executing in your Blueprints before the engine has generated PoolClass’s “Default Object”.
I see, I’m currently debugging the project using packaged builds in development. It feels like it is because of the way I have it setup and not from the Plugin, which is nice as I can debug my own code better
I’ll let you know when I come to the conclusion. But, for that invalid component error, it actually was when I started packaging, no ingame.
@ I have never in my life used Blueprint Nativization, sorry.
Many devs have implemented nativization themselves, but I have never used it, so I have no idea why nativization causes that.
I think you could try to disable it for the plugin instead; since the plugin is already running on C++ there’s really no reason to “nativize” this. It is already native C++ code.
For a heads up on the issue I was having with the Packaged project not working properly, it basically was UE not properly saving my Object-Pool project settings. I need “Instantiate on Demand” for my project to work and the default is “False”, but in project settings I set it to “True” and all works fine, but after packaging, it acts as if it isn’t working.
So what I did is simply add the default values I needed to the Config/DefaultGame.ini
Just brought and implemented the object pooling plugin and its working great, I’m creating an endless runner for mobile and after a lot of testing / figuring out performance bugs, I’ve finally cracked it. The game runs well, 120fps on my Mac and 35 fps on my android, no performance lags, just continuous frame rate, the pooling has given me that so thanks sooo much!
but
Im having trouble with my respawned coins. I’m finding that if I have hit them before or if they are picked up by a magnet kinda thing, that when they are respawned next time, they keep those magnetized settings, or they won’t get picked up before because they have already been picked up on the last spawn.
I guess whats happening is that when a coin is sent back to the pool, it is not being told to revert back to its original coin state, its being kept in ‘magnet state’ and flying from its spawn point in the distance to the player.
Is there a way to reset the coin to its original settings/state on return to pool, or a setting / checkbox that I’ve overlooked? I’m only about a month or so into learning unreal so yea a bit of a noob.
ahh, yep I have the event nodes, I mean the ‘set initial speed’ ‘set max speed’ nodes. Are you setting them from the float variable (green Bullet speed) , if so how do I get access to the target option.? or are you right clicking and calling something?
They aren’t relevant to your issue.
It’s just an example, just the red nodes matter there…
You just need to reset your magnet properties from one of those Events like the example image.
Fixed, I had marked a coin as used and that was getting carried into the pool and still active on respawn… rookie mistake Cheers for the help , plugin is magic!
I’m wondering if it would be useful to add native events do PooledActor (and similar classes) on begin/end play.
We already BlueprintImplementableEvent (EVENT_OnPoolBeginPlay, EVENT_OnPoolEndPlay) and delegate (OnPoolBeginPlay, OnPoolEndPlay).
In my project I extend PooledActor class in C++, so native events come handy.
Of course, it’s not a big deal. I used to add few lines for it after every update
Hey , I’m running 4.20.1 and either I am overthinking the entire process, or I really can’t understand your guide for implementing this plugin using blueprints. I have a gun and I want it to shoot pooled bullets using your method. I won’t go into detail for all the different ways I have attempted to solve this but I can assure you I’ve managed to crash my engine in at least 5 different ways. I understand I need to create an ObjectPoolComponent then I need to reparent my BulletProjectileBP to “PoolActor”. This is all I KNOW how to do. Now I am not sure where to put the component…
If I put it in my gun my game crashes on simulation… if I try putting it in an empty actor… it crashes as well. I’m at a loss for what to do. If you could help me understand this process I will gladly re-write your instructions so you can post it as an addendum (or preferably a replacement) to your guide… English is my native language and I am really clear with written directions… Thanks.
Hello, I set “PooledProjectile” component instead of “Projectile Movement” component to my bullets.
I set initial speed and activate them on pool begin play. But bullets with pooled projectile did not moved. How did I set something wrong ?
This project is in Unreal Engine 4.20.1