- Home /
Need help with script
I'm trying to create a script in which on trigger enter with a certain game object, the game object's prefab file will be moved to my computers desktop folder. If any one knows what I'm talking about please message me. Thanks, Matthew
Answer by OfficerSugar · Jan 12, 2018 at 05:51 PM
I don't think you're able to do that really since you're trying to do something with a file that should only be used within unity and not in a built game. Unless prefabs exist as actual files in the game's files (and i don't think they do) you cannot do annything with them. such thing is only possible to do in the engine and a way to do that would be to use the File class, using methods like File.Move (link to documentation below), also don't forget to add "using System.IO;" at the start of your script when doing anything with files.
File.Move documentation: https://msdn.microsoft.com/en-us/library/system.io.file.move(v=vs.110).aspx
Your answer
Follow this Question
Related Questions
DataBase creation on android via unity 1 Answer
Recieve Shadow from a camera culled Object 1 Answer
How to change smoothness of a material in scripts? 1 Answer
Load new scripts (post-build) through Asset Bundles. Is this even possible? 0 Answers
How to look if PlayerPref exists at the beginning of the game? 2 Answers