Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by orangeflame · Nov 12, 2012 at 02:47 AM · 2dgameobject

creating a 2d game object like doom

I'm planing on making a game and as a cheap short cut I want to have 2d objects walking around like in the original doom game and the graphics will change depending on what side you look from, what way it is facing, and possible other things if its does something or something happens to it. I think I would just have to create a script checking to see where the camera is in relation to the object and which way the object is facing in the update function and then have the script change the image based on what you put into a transform. I'm not full sure how to go about this but here is an attempt at part of it. if ( pos.x < maincamera.x && pos.y > maincamera.y && rotation.z <= 90 && rotaion.z > 180 && beingattack =true) {image = leftsideattacked;}

If it helps here is a Google found image as an example.

http://i.huffpost.com/gen/625793/thumbs/s-DOOM-large.jpg

alt text

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image IgnoranceIsBliss · Nov 14, 2012 at 05:47 AM 0
Share

This only barely rates as a cheap shortcut - unless you're a skilled 2D artist but not particularly quick with 3D modelling, of course.

avatar image EthanDoesGamez · Feb 16, 2016 at 01:31 PM 0
Share

im doing the same. would using interactive sprites work?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by $$anonymous$$ · Nov 13, 2012 at 11:15 PM

Use a billboard shader to render the object and a 3d representation for game logic. Before rendering the object check for the angle between the enemy's forward direction and the vector pointing from the enemy to you. You can change the displayed texture based on this angle value.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image orangeflame · Nov 14, 2012 at 05:45 AM 0
Share

Well thanks for replying but, after hours of research, I think I solved it. I just want to run a few test and I'll leave my script here.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to form copies of yourself that follow you when you walk? (2D Platformer) 2 Answers

How to handle a MASSIVE amount of game objects? 2 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Score system 1 Answer

2d animation how to stop your animation and set a condition 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges