Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
0
Members

what gives, scene wont spawn actor (with sprite even)?!

A topic by duderbrolomando35 created Apr 01, 2016 Views: 448 Replies: 1
Viewing posts 1 to 2

class ScriptBehavior extends Sup.Behavior

{

Test1 : Sup.Actor;

awake()

{

let MainCameraMan = new Sup.Actor("CamMain1");

//MainCameraMan.camera = new Sup.Camera(MainCameraMan);

// MainCameraMan.setPosition(0, 0, 0);

new Sup.Camera(MainCameraMan);

MainCameraMan.setPosition(0, 0, 0);

this.Test1 = new Sup.Actor("Derp");

this.Test1.setPosition(0, 0, 0);

new Sup.SpriteRenderer(this.Test1, "GameSprites/background1");

//Derp.spriteRenderer.setSprite("GameSprites/background1");

}

update()

{

}

}

Sup.registerBehavior(ScriptBehavior);



this is in a file script, and its added to a Empty actor in my start up scene (which is set to load on start), it gives me no errors and loads the screen as a BLACK object. The debugger is hard to figure out so I cant understand if something is spawning like it should or not. (unlike cosntruct 2 which is easy to see all entties in scene), anyway, Im just wondering WHAT am i doing wrong if it throws no errors? (again, this behavior has been added to an actor that is saved to the scene itself, no default camera tho, I wanted to instantiate one.) my only guess is, like in perhaps other javascript style use, I created the camera but did not append it to the scene, so its only stored as a variable and not in the scene yet?? thats weird.. doubt it cuz this engine is different?

(2 edits)

Did you set your scene as the startup scene in the settings ?

It would explain why nothing appear and stay black.

Also, make sure all your actors you want to see is z axis position before the z axis of the camera.

this.Test1.setPosition(0, 0, -1);

And did you attach a behavior component with this behavior to an actor of the scene ?