C
C#12mo ago
ZULFEN

Good afternoon, could anyone help me with some C# code?

I'm trying to make a shooting system, like those ship games. But it's not working very well, no shots are moving.
No description
11 Replies
ZULFEN
ZULFENOP12mo ago
i like chatgpt
i like chatgpt12mo ago
public float velocidadeDoLaser = 1.0f; // specify the correct value instead of the default 0.
public float velocidadeDoLaser = 1.0f; // specify the correct value instead of the default 0.
ZULFEN
ZULFENOP12mo ago
like this?
No description
i like chatgpt
i like chatgpt12mo ago
Don't forget the assignment operator =.
ZULFEN
ZULFENOP12mo ago
where do I have to add it?
i like chatgpt
i like chatgpt12mo ago
No description
i like chatgpt
i like chatgpt12mo ago
public float velocidadeDoLaser = 1.0f; // specify the correct value instead of the default 0.
public float velocidadeDoLaser = 1.0f; // specify the correct value instead of the default 0.
ZULFEN
ZULFENOP12mo ago
like this?
No description
i like chatgpt
i like chatgpt12mo ago
Adjust this value based on your test. I don't use Unity here so I don't know what the appropriate value for it is.
ZULFEN
ZULFENOP12mo ago
I did this, but the script is not being passed to the clones
No description
Buddy
Buddy12mo ago
You need to change and apply the value on prefabs too. Press overrides -> apply Top left in the inspector

Did you find this page helpful?