Spawning Animated Character on Run Time. Character Blinking. HELP!

Hi guys. New to Unity here. Not new to programming, just game dev, unity and c#.

Anyway, so I’m trying to Instantiate a character at run time and I was successful but my character keeps on blinking. I know it’s very simple but this problem has been spanning for 2 weeks. Yeah I know, kinda embarrassing but I have work and a life so I only have 30 minutes - 2 hours max a day to learn the platform… for now at least. Tried googling but none worked for me. : (

I know it’s not a prefab problem because it doesn’t blink when my character is there from the beginning. Only when it is instantiated at run time, it is blinking.

I only have one class and it looks like this:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BattleHandler : MonoBehaviour
{
public GameObject mainPlayer;

private void Start()
{
Instantiate(mainPlayer, new Vector3(-5, 0), Quaternion.identity);
}

}

Here’s what my editor looks like.
Imgur

So here’s my Battle Handler. I just simply added the prefab to mainPlayer. I have 2 characters. One which will be spawning in the left is instantiated at run time. The other one appears at the very beginning to see that the prefab is not the problem.

are your script attached to the same object you want to instantiate???
try to provide a screen shot for your character inspector

@wcatingub21

“my character keeps on blinking.”

Explanation makes little sense, post more info;

What kind of material your object has?

Are you using 3D objects or sprites?

Like @Agent003 said, more info is needed… maybe share some images of object hierarchy, used materials and code attached to blinking problem object.

BTW, code in posts should be formatted, here is how:

Probably this issue?

Sorry
Here’s what my editor looks like.
Imgur

So here’s my Battle Handler. I just simply added the prefab to mainPlayer. I have 2 characters. One which will be spawning in the left is instantiated at run time. The other one appears at the very beginning to see that the prefab is not the problem.

Thanks for the info. I’ll make sure to use this code in posts next.
And no, no 3D objects or sprites here. ALL objects are 2D and this is a Unity 2D project. I’ve downloaded these from the Asset Store.

unfortunately, no. GPU skinning is unchecked by default for me.

@wcatingub21

“I’ll make sure to use this code in posts next.”

  • nothing prevents you from editing your current post.

"Here’s what my editor looks like.
Imgur: The magic of the Internet"

You can attach images to forum post with “upload a file” button. But I don’t think that helps much, I see that you have a component attached, and some sprites in your scene, that is pretty much it.

So again, one has to start guessing…

What is the sample_ground object? Is it a sprite? How have you setup the sprite ordering compared to your characters? How have you setup you background?

Which renderer are you using?

Which Unity version are you using (although it is now evident from the screen shot, it isn’t from the post).

As you can see, you should really put effort in writing your question, it is quite useless to start guessing all the details.