How do I make my object appear? SOLVED

I’m trying to make an object (FrontEnemy) fade in, but it’s not showing. The test text (NewObject8) changes, but nothing else happens.

I checked to make sure the object is in view of the camera on the game page, so that can’t be why…

What can I change about my code to get the object to appear?

You do things with the object before you create the object.
Move the Create object action up.

I moved the action up, but that isn’t working.

The object appears at the beginning, when it shouldn’t, and the opacity and timers aren’t working. Is there another way?

Has the object added the Tween behavior? Check this because sometimes if you copy paste the Tween even the object is not recognized.

What @jack meant move the create action up the in the event it was in, not move it up into another event.
What you were doing was changing the animation of the object and tweening it’s opacity before it was created.

Not that far up.
The order within an event is also important.

I think I made the changes you suggested.

For Ulises’s question, yup, the enemy has the tween behaviour. I just checked to make sure.

The enemy still isn’t appearing, though. What else could we try?

You create frontEnemy at 1618 on the x axis. Is that where the camera is? Does the word “Success” appear in NewObject8?

I suggest you do a little debugging for yourself. In the second event, take out both conditions. Does the sprite appear? If so, add the conditions, one at a time and preview again, until it fails.Tthe last condition you added will the bug.

Also, you are still referencing frontEnemy in the first event. Unless you have one already in the scene, it’s accessing something that doesn’t yet exist.

I see this isn’t your scene script, so I assume it’s an External Event. Is it linked to in the scene events?

Yup, it’s an External event that I linked to the test scene.

Also, I got it to work! Here’s what I changed:

I still need to tinker with other events, but the enemy object appears with the timer and fades in and out as programmed!

Thanks for helping me, guys. I’ve been trying to get this working for at least a week and I got a breakthrough tonight!

1 Like