PDF – Working Dynamically with PNG Files in Unity – KNOW THYSELF AS A VIRTUAL REALITY (2024)

How to export a PNG file for Unity, then import it into a project, make it a sprite, and attach scripts so that it can be thrown around in VR. Great for adding elements to a scene which would otherwise be too complex to make and run in Unity.

Scripts required: GenericLoader, Sprite Renderer, OVR Grabbable Extended, Manage Text Slice Movement, and more can be attached as desired!

GitHub link: https://github.com/Know-Thyself-as-a-Virtual-Reality/KTVR-DICOM-Tools

VIMEO link: https://vimeo.com/726184570

Step by step (preparation):

  1. If you don’t already have the Oculus Integration package with OVRPlayerController installed, instructions can be found here.
  2. Download the project file, which can be found here under DICOM Tools.

Step by step (getting your PNG ready):

  1. Create a greyscale image with a transparent background in a program such as Adobe Illustrator (tonal values will be maintained in Unity when colors are applied later, so it could be worth getting them looking right at this stage).
  2. If working in Adobe software, click File, then go to Export, then select Export As…. Make sure PNG is selected from the dropdown menu (fig. 1). Export the file; a larger file size is often better as it can be downsized in Unity as needed.
  3. Locate the Unity project folder on your computer and open the Assets folder within it. Then find the Resources folder and add an Images folder inside it.
  4. Move your PNG into the Images folder so Unity will have it ready to open.

Step by step (working with PNG in Unity):

  1. Open your Unity project, and in the Project window navigate through the folders (Assets, Resources, then Images) to find your PNG (fig. 2).
  2. Select the image in the Project window, then in the inspector, change Texture Type from Default to Sprite (2D and UI) (fig. 3). Click Apply at the bottom of the window to make the PNG into a sprite.
  3. Drag and drop the PNG sprite into the project hierarchy window and it should appear in the scene automatically (fig. 4).
  4. If the PNG sprite is too large, it can be resaved from Illustrator or resized in Unity by adjusting the Transform Scale in the inspector (fig. 5).
  5. Select the PNG sprite in the hierarchy and the Sprite Renderer should appear in the inspector (fig. 6). Here, color, orientation, etc. can be edited.
PDF – Working Dynamically with PNG Files in Unity – KNOW THYSELF AS A VIRTUAL REALITY (1)

Fig. 1
Ensure that PNG is selected when exporting the file

Fig. 2
Location of the Images folder as seen in Unity

PDF – Working Dynamically with PNG Files in Unity – KNOW THYSELF AS A VIRTUAL REALITY (3)

Fig. 3
The Texture Type for the PNG should be Sprite (2D and UI)

PDF – Working Dynamically with PNG Files in Unity – KNOW THYSELF AS A VIRTUAL REALITY (4)

Fig. 4
Drop the PNG sprite into the Hierarchy (right) and it should appear in the scene (left)

PDF – Working Dynamically with PNG Files in Unity – KNOW THYSELF AS A VIRTUAL REALITY (5)

Fig. 5
Adjusting the sprite’s scale within Unity by changing Scale values under Transform in the Inspector window

PDF – Working Dynamically with PNG Files in Unity – KNOW THYSELF AS A VIRTUAL REALITY (6)

Fig. 6
Sprite Renderer settings; here the color has been changed to red

Note:

  • Some versions of Adobe software might feature a checkbox to toggle transparent background on/off when exporting PNG files
  • If working with many PNGs, they can be organized within a game object
  • Scripts are added by selecting the object in the hierarchy that you’d like to attach the script to, then simply clicking Add Component in the inspector window. You can search for and add scripts and components as desired
  • Check out this tutorial on selecting and editing objects in VR for more!
PDF – Working Dynamically with PNG Files in Unity – KNOW THYSELF AS A VIRTUAL REALITY (2024)
Top Articles
Gift Giving as a Form of Control [Updated 2024] - GiftAFeeling
3 golden interview rules: be prepared, be professional, and most importantly, be yourself - Ellis Mason Recruitment
Comerica Park - Detroit Tigers
Grupos De Cp Telegram
TCP and UDP ports used by Apple software products - Apple Support
Life And Wealth Mastery Fiji Cost
Muncie – Travel guide at Wikivoyage
How to find the value of your snowmobile
Katinakay Leaks
184€ Flug Frankfurt am Main - Lahore - Günstige Flüge von Frankfurt am Main nach Lahore - KAYAK
888-747-2264
Panama City News Herald Obituary
Tnt Tony Superfantastic
Sni 35 Wiring Diagram
Apartments For Rent Seattle Wa Craigslist
Sounder Mariners Schedule
Which Country Has Hosted A Summer Olympics Microsoft Rewards
Rubfinder
Busty Roommate
855-409-4227
McCarran International Airport Guide
Scammer phone number lookup. How to check if a phone number is a scam
Www Silverdaddies.com
Jaguar XJ gebraucht kaufen bei AutoScout24
Maritim Museum Peenemünde U-461: Kolossales Museum
Sharp Urgent Care Wait Times
O'reilly's Lancaster Wisconsin
Greythr Hexaware Bps
Baptist Primary Care Lakewood
Insidious 6 Breaks A Blumhouse Promise That Was Only Made 10 Months Ago
Hartford Healthcare Employee Tools
Face Split Diving Accident 2022
Busted Barren County Ky
Froedtert Billing Phone Number
Blower Motor Resistor Autozone
Woo Pig Softball Tournament 2023
Urban Ice Organics Kratom Reddit
Deer Shed Clover Sc
Rettungshund Ruby bei Netflix: Alles zu Start, Besetzung und Handlung
Autozone Ac Condenser
Yh50 Pill
Infinite Campus Farmingdale
Tyrones Unblocked Games Basketball Stars
Cvs Newr.me
Raleigh Register Herald Obituaries Beckley Wv
Spn 792 Fmi 2
Latina Busty Webcam
Epower Raley's
0Gomovies To To
Hmnu Stocktwits
Latest Posts
Article information

Author: Jamar Nader

Last Updated:

Views: 5484

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Jamar Nader

Birthday: 1995-02-28

Address: Apt. 536 6162 Reichel Greens, Port Zackaryside, CT 22682-9804

Phone: +9958384818317

Job: IT Representative

Hobby: Scrapbooking, Hiking, Hunting, Kite flying, Blacksmithing, Video gaming, Foraging

Introduction: My name is Jamar Nader, I am a fine, shiny, colorful, bright, nice, perfect, curious person who loves writing and wants to share my knowledge and understanding with you.