How do I make my object appear? SOLVED


#1

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?


#2

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


#3

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?


#4

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


#5

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.


#6

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


#7

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?


#8

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.

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


#9

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!


closed #10