Can I copy a deleted GameObject [closed] - c#

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I am trying to copy GameObject(enemy) in a circle radius around the player. I've got that part but i need to delete the original GameObject(The One that I am copying). I am thinking of somehow saving the one that I am copying but I don't really know. Please help.

If you actually delete it (destroy it), copy won't work.
You can:
copy it before deleting
disable the GameObject (go.setActive(false)).
Instantiate a new gameobject, instead of copying.

I found the answer! If you have the same problem, just deactivate the original object.

Related

Why does my unity buttons stopped working? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 10 months ago.
Improve this question
I'm following an online course and then I noticed that the buttons just stopped working.
Here are some images The Scene View, Game Over Canvas Components, Game Over Text Components, Restart Button Components(The Broken Button), Leave Text Components(The Other Broken Button), The Script That Have Something to do with the canvas.
I've tried multiple solutions on the internet and nothing works and I think I didn't mess with anything else but the colors and the text in the button. I just want the buttons to work like it's a button.
your EventSystem Object maybe deleted or disabled, try to recreate it:
It will created automatically when you create UI/Canvas:

How to add watermark to an image in unity? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I was following this solution Unity watermark on image after screenshot to add watermark to the image but it does not go forward from a line. I am using unity 2018.3.8f. If someone can help it is the matter of my job I am stuck in this for five days.
Color[] whatermarkPixels = whatermarkTexture.GetPixels();
Most probably you get the same error as the OP of the linked question, Something like
texture not readable, the texture memory cannot be accessed from scripts. You can make the texture readable in the texture import settings
Just as it says you have to mark that texture as readable. Otherwise GetPixels fails.
For the one you have as an image file (the watermark) you can do it via the Import Settings simply enable the Read/Write Enabled option and hit Apply

C# Ton of Errors [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I'm coding a Text-Based RPG currently, everything was going fine but then I guess I did something that destroyed my code, I'm not sure what I did but I now have 242 errors. My code is in a GhostBin File (Just a website where you can paste your code to show others):
https://ghostbin.com/paste/qp9k8
If anyone could find a reason as to why my code is all broken, help would be highly appreciated.
Thank you,
Anthony.
Remove line code
public class Inventory {
You can not define a class inside Main function.

Is there a way to make objects invisible while editing your form in C#? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
Is there a way to make objects invisible while editing your form in VC# / C#.?
I want to make my image and panel invisible while editing my form in Microsoft Visual Studio Express 2015 and even if I make it invisible during edit will I don't want it to stay invisible when the program runs.
Is there any way?
Thanks
You go into the designer file (a ".cs" file) and find where the particular control is added into the form. e.g:
this.Controls.Add(button1);
And then you either delete this line or comment it:
//this.Controls.Add(button1);
Hope this helps

C# Play wav file with selected range time [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
Would you please give me solution due to play wav file with selected range time via C# ?
I used NAudio, but it seems not support this feature.
Thanks
This might be what you're looking for:
How do I create a seekbar in C#\NAudio Music Player?
It has audioFileReader.SetPosition() and audioFileReader.Seek() which you can use to set your range.

Categories