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"

Can a character bp spawn another character bp?

I have an enemy in my game that creates periodically other enemies, so this is a Character Blueprint that has a Spawn actor from class inside of it, and the class spawned is another Character Blueprint.

The problem is that when the other enemy is spawned, my game freezes for 1 second just before the spawning, and then it spawns the enemy normally after unfreezing. I don't know why it freezes, so I'm becoming to question if this is something I'm not supposed to do.

I have Actor Blueprints that spawns Character Blueprints and Character Blueprints that spawns Actor Blueprints and they are implemented the exact same way and work just fine, so I don't know why this case in specific is causing me troubles.

Can someone please help me?

Product Version: UE 4.17
Tags:
more ▼

asked Aug 12 '17 at 04:19 PM in Blueprint Scripting

avatar image

Xyuan
11 1 2 2

avatar image Xyuan Aug 12 '17 at 04:25 PM

Also, if anyone is wondering if the problem is my Character Bp that is being spawned, I have another Actor Bp that spawns the same Character Bp the exact same way and it doesn't freeze.

avatar image RimmyD Aug 14 '17 at 03:13 AM

Some questions:

Is this multiplayer?

Are you spawning it on top of the character or offset from him?

Where is the spawning logic triggered from? tick/timer/etc

avatar image Xyuan Aug 15 '17 at 12:29 AM

No, it's not multiplayer. And no, its spawning away from the character. The spawning logic is triggered from the Character bp. When I spawn a simple actor, at the same location, it doesn't freeza, but when I spawn a character, it freezes =/

avatar image Xyuan Aug 15 '17 at 12:34 AM

The spawn is triggered in a "On Component Begin Overlap" and I remove the collision of the specified component as soon as it runs. It's a "ball" that when falls to the ground, spawns an enemy, like an egg that broke.

avatar image Xyuan Aug 15 '17 at 10:34 PM

Ok, I tried something different now..

Now I created an Actor BP (X) that spawns a Character (Y) whenever it overlaps something.

Then, I made another Actor BP (A) and another Character BP (B), both spawning my actor X from a safe distance. In both cases, they spawn the actor X with no problem at all, but while the character Y spawned by the actor X created by A (A -> spawns X -> spawns Y) had no freezing, the character Y in the B case (B -> spawns X -> spawns Y) had the 1 second freeze.

So, TLDR:

  • Actor A -> spawns Actor X -> spawns Character Y -> no freeze

  • Character B -> spawns Actor X -> spawns Character Y -> 1 sec freeze

Both uses the exact same blueprint logic and functions. Curious.. I have no idea what else to try =/

avatar image RimmyD Aug 16 '17 at 02:22 AM

Do you see anything in the log when you spawn?

Make sure to put some print nodes on the events for overlap and hit on all affecting objects and characters to make sure you aren't getting a bunch of overlaps. I know you said you are removing collision, etc but it's very easy to miss something or do it too late and I don't really see anywhere else with my current understanding of your system that could cause the issue.

avatar image Xyuan Aug 16 '17 at 02:55 PM

Thanks for the help. I discovered what was the problem: spawning a character that had the same skeleton mesh as my player char. I just copied it and named something different and it stopped freezing :D

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

1 answer: sort voted first

I figured out what was the problem: spawning a character that had the same skeleton mesh as my player char. I just copied it and named something different than the original and it stopped freezing :D

I have no idea why that was a problem, but I know this solves it.

more ▼

answered Aug 17 '17 at 01:56 AM

avatar image

Xyuan
11 1 2 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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