Jump to content

  • Log In with Google      Sign In   
  • Create Account

How can I put 2d sprites in a 3d world?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 mk.jr.fan   Members   -  Reputation: 537

Like
0Likes
Like

Posted 30 September 2012 - 11:02 AM

Hi I'm just starting with Unity and I wanted to make a game that uses 2d sprites for the player and enemies and then use the 3d world to make the background. I have read into things like orthello 2d but I wanted to use the perspective view and not the orthographic view. Im pretty sure its possible to do but the thing is I don't know how to do it.

I haven't started with Unity to much, but I have made games before with a 2d engine and understand the logic behind coding. I know some java and javascript.

How can I achieve this in Unity?

Sponsor:

#2 Black-Rook   Members   -  Reputation: 1563

Like
0Likes
Like

Posted 01 October 2012 - 01:17 AM

I don't use Unity, but if I wanted to put a 2D sprite in a 3D world, I would make a plane and have the 2D sprite as a texture.

Make a plane like this:

Posted Image

Then add a texture which is your 2D sprite, and you're done!
GameDev Journal: http://www.gamedev.n...-rooks-journal/

OpenChess - 1.0 done!

Classic RPG #1 - Task 9 -> January 1st 2013

#3 Lauris Kaplinski   Members   -  Reputation: 841

Like
1Likes
Like

Posted 01 October 2012 - 02:37 AM

The correct term to use/search for help is "billboard". I.e. you create a rectangle, apply texture and keep it always faced to camera. Normally this is used for things like UI elements (think about health bar above character's head), particles (sparks, smoke, fire) etc. but you can use it for sprites as well. More advanced billboarding uses vertex shader, but for simpler cases you can just modify the transformation of your rectangle object every frame.

Unity Wiki page about billboard: http://wiki.unity3d.com/index.php?title=CameraFacingBillboard
Lauris Kaplinski

First technology demo of my game Shinya is out: http://lauris.kaplinski.com/shinya
Khayyam 3D - a freeware poser and scene builder application: http://khayyam.kaplinski.com/

#4 mk.jr.fan   Members   -  Reputation: 537

Like
0Likes
Like

Posted 01 October 2012 - 01:28 PM

The correct term to use/search for help is "billboard". I.e. you create a rectangle, apply texture and keep it always faced to camera. Normally this is used for things like UI elements (think about health bar above character's head), particles (sparks, smoke, fire) etc. but you can use it for sprites as well. More advanced billboarding uses vertex shader, but for simpler cases you can just modify the transformation of your rectangle object every frame.

Unity Wiki page about billboard: http://wiki.unity3d....FacingBillboard

When you say build boarding is for textures and UI that makes me think when I try buildboarding with a character it won't animate. Is that true?

#5 jefferytitan   Crossbones+   -  Reputation: 2123

Like
0Likes
Like

Posted 01 October 2012 - 03:17 PM

Remember when searching that it's "billboarding" (like a billboard), not "buildboarding".

There are various things in the Unity forums about it, e.g.:
http://answers.unity3d.com/questions/26770/prefab-billboard-with-a-transparency-texture.html
http://forum.unity3d.com/threads/1093-Importing-Image-Sequence-W-Alpha-Animated-Billboard-Texture

#6 mk.jr.fan   Members   -  Reputation: 537

Like
0Likes
Like

Posted 01 October 2012 - 04:30 PM

How difficult is this going to be and how much time would it take to use the billboarding on a character with 5 animations (walking left and right, jumping, falling, and standing still)?

#7 boohillie   Members   -  Reputation: 210

Like
0Likes
Like

Posted 01 October 2012 - 09:13 PM

Shouldn't be too difficult.

In addition to the billboarding that has been mentioned, you could use a materials mainTextureOffset to step through a sprite sheet.

The following is very a quick an example I found on youtube demonstrating this.


You could build a sprite sheet with multiple rows of animations such as: idle, walking, jumping, falling, dying, etc.

On another note, I happened to run across this interesting article some time back, a tech review of MikaMobile's Zombieville USA. I thought it was kind of neat how they used Coral Paint to create the images, then used Maya for the animation of textured planes.

#8 mk.jr.fan   Members   -  Reputation: 537

Like
0Likes
Like

Posted 02 October 2012 - 06:17 PM

looks interesting I will look into it thank you!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS