Cast to for Spawning Issue

I’ve created a widget with two buttons each for spawning as different objects and i’m casting after the button click to a blueprint named MyGameInstance however the casting is failing. I know that the spawning function works as I had it working on the widget before however I want to have it on a separate blueprint to help with replication as currently client to client actors cannot see one another. Any Advice?

Any ideas anyone? :slight_smile:

I’m having the same issue as you are, I am appalled at the UE4 community sometimes as you probably won’t receive an answer if I figure out a solution to this issue I will let you know, This engine seems to be having serious issues with casting as of recent. I’m trying to cast to my spawnpoint Actors and use their locations as well… spawn points something so arbitrarily simple, but my player characters constantly fail to be able to cast to them which is the last thing I need to get out of my way before I can distribute the core game for testing to my friends.

What on earth are you talking about? “Cast to” nodes work fine. They worked exactly they should in every single build I have ever used. Anyways, the solution to the problem is that you need to plug in an object so it can cast that object to something as in the attached example. Also, make sure that you set your game instance in the Maps&Modes options in Project Settings.

36301-blueprint.png

If they are working properly call on an array using the get command and try and get it to cast. I figured out how to get what I wanted differently (I was making a random spawn algorithm) I’m not the OP I had to shudder use c++ to call from an array and cast from it. I have really bad joints in my left hand so my typing is slow and painful, I try and use BP for everything.

I prefer blueprints over C++ just like you. It should be possible to use cast to nodes with arrays in loops or after using a “get” node with random integers. If you don’t mind telling how you want the spawn system to behave, I may be able to create an example blueprint and post here.

That’s how I called it, it didn’t work however it could not find the reference through the get command I had a complicated random array that prioritized spawns that had no enemies around them, I also made a simple spawner that just used a rand int and neither could “find” the reference to the spawner object even though I could pull functions and vars in the blueprint through the cast visually.