Hot answers tagged

6 votes

How do i play mp3 files in Unity Standalone?

To be able to play .mp3 files on desktop, you'll need help from an external library to convert it first to another format. You can use NAudio to convert the audio from MP3 to WAV before playing it. ...
TheBITLINK's user avatar
5 votes
Accepted

How to implement large data files without using up a lot of space at runtime?

You can compress images individually, then align all of those into your own data file images.big, with a header index so that you can find each compressed image at runtime. The index will have the ...
RobStone's user avatar
  • 454
4 votes

Is there a way to convert built Unity game back into a project?

No, you cannot unpack a Unity build into the source files for the project. You can decompile the managed assemblies to get equivalent C# code out of them, but it won't be exactly the code you wrote. ...
DMGregory's user avatar
  • 133k
4 votes

Unity - Where should downloaded level data be stored?

I don't think placing game related files in My Documents/My Games/ annoys users, it's pretty much standard to put it there so why don't you do it? Each user can ...
Madmenyo's user avatar
  • 1,969
3 votes

Reading from txt causes null pointer exception

Every time you call readLine() it moves ahead in your file. So on every loop you're actually reading 4 to 8 lines instead of 1. Once you run out of lines to read, readLine() returns null which ...
Stephane Hockenhull's user avatar
3 votes

MonoGame "couldn't find a default importer" for .txt file?

You're getting this message because the pipeline doesn't contain a content importer for a .txt file. Plain-text files generally don't require any special processing, and don't need to be converted to ...
Vassalware's user avatar
3 votes
Accepted

How to make a string[] from the words of a file in Unity?

You can split a string into substrings with String.Split. When you don't have any whitepsaces in that textfile but line breaks (as in no words with spaces in them) ...
Philipp's user avatar
  • 119k
2 votes
Accepted

Reading a Binary File in Unity

Your file is not a binary file. It contains ASCII text, starting "1e"... The value of which is 65 31 in Hex (Little endian encoded), Or 25905 in Decimal. 1e44(ascii)= 34 34 65 31 (hex) = 875849009 (...
JeffUK's user avatar
  • 220
2 votes
Accepted

Where should I store textures for a game?

Well you want to store any game assets in a place that people won't usually mess with. Putting them in the documents folder will make it likely that someone comes across them, doesn't recognise them ...
user3797758's user avatar
  • 3,631
2 votes
Accepted

Loading settings files better?

risk of crashing if someone edits the file incorrectly If the configuration is invalid, then it should not work. You should verify if the data on the file is valid (e.g., It has all the fields, it ...
Theraot's user avatar
  • 26.2k
2 votes
Accepted

How to store localized text data in Unity?

Unity has built-in support for storing localization data. Import the localization package from Unity's package manager, and check out the Quick Start Guide. It supports localization for ...
Evorlor's user avatar
  • 5,783
1 vote

Is there a way to convert built Unity game back into a project?

Yes, you can. Try programs like AssetRipper (which's a fork of uTinyRipper program). How well these programs cope with unpacking depends on the unity version, the older it is, the better.
random guy's user avatar
1 vote

cant add unity scripts to obects "unity_csc.bat not found. Is your Unity installation corrupted?"

I had a similar issue, and it was caused by the Antivirus (Avast): it had quarantined that file. I fixed it by adding and exception for this file and removing it from quarantine. I did reinstall ...
White Crow's user avatar
1 vote
Accepted

cant add unity scripts to obects "unity_csc.bat not found. Is your Unity installation corrupted?"

The error to this could not be traced and it is assumed that the installation was corrupted. This was fixed by re-installing all of unity and it worked!
Object's user avatar
  • 289
1 vote

How can I import an Excel file in an Unity WebGL game?

When your WebGL game needs to read an arbitrary file, then you can add it to the game build by turning it into a text asset. You need to rename it to give it the file extension ...
Philipp's user avatar
  • 119k
1 vote
Accepted

How to get Unreal find headers needed for my code to work?

After some searching I found this: I my header I changed the includes to this: ...
formatc2013's user avatar
1 vote

How big can a background file in Unity be?

Since it is for your actual world, you want to go by tiles. That means you have a sprite sheet and build your world of multiple of small pieces by it. There are a lot of tutorial on how to build ...
Zibelas's user avatar
  • 4,131
1 vote

Why are my records duplicated when writing them to a file?

Remove the 2.0f from the end of InvokeRepeating The second argument is a repeat rate so it is saving it 3 times (the executed ...
Justin Markwell's user avatar
1 vote

Cannot find folder when building game to .jar LibGDX

Just like the error says, you can not list all assets in a classpath FileHandle. The reason you're seeing this error even though you're using an ...
Charanor's user avatar
  • 7,840
1 vote
Accepted

Importing audiofile into Unity3d gets shown after ending playmode

The comment from DMGregory made me realize that it was the compiler that was processing the new added file. This however only happens outside of playmode and only in the editor. With this came the ...
ploopploop's user avatar
1 vote
Accepted

Unity3D : Where to put external files?

Look at StreamingAssets. When you build your projects, all folders and files are packed, making it difficult, or even impossible, to edit. All except one folder. The StreamingAsset folder. Retrieve ...
Basile Perrenoud's user avatar
1 vote

Let player upload text file in-game Unity

There are multiple ways to get some bytes of text from the client to a server. But one way to do this which should be quite platform-agnostic is with a HTTP POST Request. The Unity class you need for ...
Philipp's user avatar
  • 119k
1 vote
Accepted

Import Unity Package Into Specific Folder

The way I do it is that I always create a new project first where I import the unity package file. I then change the structure of the project as I want it to look in my final project. Finally I select ...
Frank Servy's user avatar
1 vote

LibGDX search for file types in local file system

You could use Files.walk() along with filter(). Thus if you wanted to get all PNG images, then you could do: ...
vallentin's user avatar
  • 380
1 vote

AudioSource not working. Empty Exception

I've managed to solve my problem converting my byte array directly in a AudioClip using the code posted by Jeff Kesselman in this topic http://answers.unity3d.com/questions/737002/wav-byte-to-...
Raphael Rosa's user avatar
1 vote

LibGdx: search through text file without lots of String garbage

It sounds like you don't want to create a whole bunch of String instances for the GC to clean up, so how about using one or more ...
Ross Taylor-Turner's user avatar
1 vote

Why can't I read .ttf file when running Android configuration?

If your test desktop filesystem is running on Windows NTFS and the Android device filesystem is on Android native, the difference is in the filesystem drivers. The Windows filesystem drivers are not ...
Robert Wm Ruedisueli's user avatar
1 vote

Which Unreal Engine 4 project files can I ignore in source control?

This is what I have in my .gitignore ...
Shital Shah's user avatar
1 vote

How do I save files with libgdx so that users can't read them?

The following code will create a text file where you can store basic data ...
Khaledonia's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible