x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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?

Spawn_GUI MyGameInstance

Product Version: Not Selected
Tags:
spawn_gui.jpg (499.8 kB)
more ▼

asked Mar 16 '15 at 03:05 PM in Blueprint Scripting

avatar image

Maniasmurf
1 1 3 5

avatar image Maniasmurf Mar 17 '15 at 09:20 AM

Any ideas anyone? :)

avatar image Chinchy Mar 28 '15 at 06:51 AM

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.

avatar image alperenakyuz Mar 28 '15 at 09:32 AM

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.

Example

blueprint.png (30.1 kB)
avatar image Chinchy Mar 28 '15 at 01:59 PM

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.

avatar image alperenakyuz Mar 28 '15 at 02:42 PM

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.

avatar image Chinchy Mar 28 '15 at 08:34 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question