Stingray Forum (Read Only)
Welcome to Autodesk’s Stingray Forums. Share your knowledge, ask questions, and explore popular Stingray topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Character Spawn

6 REPLIES 6
Reply
Message 1 of 7
iGeorge93
275 Views, 6 Replies

Character Spawn

Hi there.

 

For sometime I've been trying to work out how to spawn a character within stingray. I'm using the basic project, therefore I don't have the player start gizmo in the create panel.

 

I've been told that it can be done by two nodes in the level flow, and I'm struggling to get this to work.

 

Can anyone help me out please?

 

Edit: Forgot to mention, I'm wanting to spawn the character when the project is launched, and also when a new level loads within the project.

 

6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: iGeorge93

Hi,

Refer this tutorial, http://help.autodesk.com/view/Stingray/ENU/?guid=__tutorial_link_tutorials_on_area_html. You will surely gain some important insights regarding spawning.

Thank you

Tags (1)
Message 3 of 7
_robbs_
in reply to: iGeorge93

If all you're trying to do is spawn a unit when the level is loaded, you can do it in the Level Flow.

Open up your level in the editor, and go to the Level Flow tab.

 

Start with the Level Loaded node. Add a Unit > Spawn Unit on Position. node. Then wire the Out event from Level Loaded into the Spawned input event on the Spawn Unit node. Set the Unit setting on the Spawn Unit node to the unit you want to spawn. Then set the initial position and rotation you want for the new unit, or leave the defaults to spawn at the center of the level.

 

flow_spawn.PNG

 

If you're trying to work with the character from the character project, that's a little trickier because that character is set up and spawned in the character project's Lua code.

Message 4 of 7
iGeorge93
in reply to: _robbs_

Thanks for that, that's helped me with something I wanted to do for another project. But I still don't know how to spawn the character.

Message 5 of 7
_robbs_
in reply to: iGeorge93

what character are you trying to spawn?

Message 6 of 7
iGeorge93
in reply to: iGeorge93

The main character in the basic project. I'm not sure if it's an actual character, but I know there's a character under the model folder within the project, but I'm pretty sure that's only a collision model. Or is it just a camera?
Message 7 of 7
_robbs_
in reply to: iGeorge93

Ah, I see.

 

That "character" unit is used only when you're in "walk" mode, which you enter by hitting F2.

 

By default, the camera is in a Fly mode. When you go to walk mode, the character is spawned and the camera is attached to the cylindrical character unit. That character unit is set up with a collision actor and a mover (which you can see if you go into the Unit Editor) so that as you move around the scene in walking mode, you can't walk through other physical objects like the box.

 

(The reason you don't see it while you're in walk mode is just that you're inside it, and its material is one-sided.)

 

The logic that sets up that spawning is all done in the script/lua/player.lua file, if you want to see how it works.

 

All that said, if you use the Flow that I pasted above, you should see the static cylinder unit get spawned in the middle of the level. However, that instance won't be hooked up to the movement controls in the player.lua script. It'll just be a static cylinder sitting there in the middle of the level.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report