Spawn a NPC with a velocity?

This is the place for discussion and support for LunaLua and related modifications and libraries.
Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
BananaCat
Swooper
Swooper
Posts: 50
Joined: Fri Dec 30, 2016 6:20 pm

Spawn a NPC with a velocity?

Postby BananaCat » Tue Feb 07, 2017 2:37 pm

Im almost done with this piece of code, thanks to who helped! But how do you do it?

BananaCat
Swooper
Swooper
Posts: 50
Joined: Fri Dec 30, 2016 6:20 pm

Re: Spawn a NPC with a velocity?

Postby BananaCat » Tue Feb 07, 2017 2:39 pm

ohn crud, I accidently put this in General...

PixelPest
Raccoon Mario
Raccoon Mario
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Spawn a NPC with a velocity?

Postby PixelPest » Wed Feb 08, 2017 6:52 am

When you spawn the NPC via NPC.spawn, set it to a local variable. Then do variable.speedX and/or speedY and set a value to it. For example:

Code: Select all

local npc = NPC.spawn(<args here>);
npc.speedX = #; 

timocomsmbx2345
Nipper
Nipper
Posts: 850
Joined: Sat Feb 06, 2016 1:44 pm
Contact:

Re: Spawn a NPC with a velocity?

Postby timocomsmbx2345 » Thu Feb 16, 2017 9:18 pm

like a faster velocity than a thwomp?

MacDuckBeat
Panser
Panser
Posts: 1055
Joined: Fri Oct 07, 2016 8:09 am
Flair: Neon and edgy artist hehe
Pronouns: he/him
Contact:

Re: Spawn a NPC with a velocity?

Postby MacDuckBeat » Sat Feb 18, 2017 7:33 am

timocomsmbx2345 wrote:like a faster velocity than a thwomp?
Lmao, you made me laugh. :lol:
I think what the title says like spawning the NPC super fast. Eh ?


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 0 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari