UE4 - MyCharacter dissappears while playing in editor

I am working on my side scroller project for school. Its looking amazing and im almost done with level. big issue is at random times at different positions of game (never in spot or time frame), my character randomly disappears.

I don’t have any blueprint that states to destroy MyCharacter.
I my killzone is set to - 1 Trillion, or more I didn’t count zero’s.
I even put a random box shape and set collision to block all at -3000.00 and it covers completely under map and runs on 1000 on each side.
No errors pop up when I end gameplay.

But what I think could be a hint is sometimes rather I have a ai shooting at me or turret far in distance, AI continues to shoot. or far turret turns right and shoots downwards at ground. They are only supposed to target MyCharacter BP

So if anyone knows about this problem or knows how to fix it. Lets let this be final answer.

Thank you for reading. I really appreciate everyone’s time.

Hi ,

Most likely this is a rendering issue. During Play, you can look in World Outliner for all Actors in game, and you’ll probably still see character listed when this happens.

Does camera angle change at all when this happens? Does character reappear if you move it to another place? Does this only happen in specific locations in your level?

If you’d like, I can take a look at project to see if I can figure it out real quick. Upload project somewhere like Dropbox or Google Drive and get me a download link. You can do it privately by sending me a PM on forums, if you’d prefer:

To answer your questions,
MyCharacter BP does disappear.
CharacterController is still there.
Camera Angle turns 90 degrees to right, but one time i do remember camera just freezing and character dissappears.
There is no function control or anything of sort, so no movement generated. This does not happen in any specific location or time that i can see consistently. Please allow me some time to upload to google drive its a big file. Thanks for response, i will comment again when its ready.

Is your character destroyed? If you trace character each tick does it return none at any point? It should be easy to print out his location each tick as well.

@RimmyD yes it is destroyed. When i check world outliner it is gone :frowning:

Thanks for project! I’m testing it out, but I’m just not seeing this happen. What do I have to do in game to make it happen, approximately? How long does it take? How often does it occur? Is anything in particular being done when it does occur? Like a button press, or an overlap, or anything like that? Or can it happen while character remains still?

Its a complete random thing that happens at random times, I have noticed it occur several times while standing still. It will occur every gameplay if i don’t get mad and quit from losing :P… But as far as i know it happens out of complete random.

@ Haliday. Were you able to recreate problem at all?

Yep! Just running game, character is destroyed after a set amount of time. I’m going through project and removing pieces bit by bit to try and find source of problem, but you have so much stuff running on Tick that it’s hard to track. I spend a couple hours with it yesterday, and I’ll try again this afternoon. I’ll let you know as soon as I track it down.

is it bad to have so much stuff on event tick

You generally don’t want anything running on Tick that doesn’t absolutely have to. Tick runs every frame, which means overloading it is very possible. Additionally, it means your system can run differently on different system with different framerates.

Take a look at this Twitch stream we did with some general Blueprint advice:

https://www…com/watch?v=RwbkvUEgCls&list=PLZlv_N0_O1gbggHiwNP2JBXGeD2h12tbB&index=3

Generally, it’s preferable to run things on Timers, and call those timers when they’re needed. Here’s some documentation on Timers:

https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseTimers/Blueprints/index.html

But for now, since this is for class and I’m guessing you need to turn it in eventually, it’s probably not a great idea to overhaul your entire Blueprint setup if you don’t need to =) So I’d like to find what’s destroying character, and hopefully it won’t require that overhaul.

Hi ,

Looks like it was a much simpler solution: your Character’s Initial Life Span was set to 100. This means it will only live for 100 seconds, and then be destroyed.

In your MyCharacter Blueprint, go to Class Defaults and search for Initial Life Span (it’ll be down at bottom). Set this to 0.0, and it will last for entire game session.

Hope that helps! Let me know if you have any questions.

@ Haliday - thank you so very much for help, im sorry about sending you on a wild goose chase. This makes me feel stupid, hahaha. Thank you for your dedicated hours to finding solution to my problem. This really helps. Also thanks for Links, i will be implementing those ways to my next project. I really appreciate it.

No problem, happy to help!