2 Likes
Very cool! By the way, did you know you can structure your variables like this?
float x = 0, y = 0.01f, z = 0;
Prevents you from writing float
so many times.
Cheers for your journey!
Matt.
2 Likes
Thanks, I will made another project and try the code
1 Like
Simple Question , If i write [SerializeField] Before This Code
Is This True??
If that’s what you mean then yes:
[SerializeField] float x = 0, y = 0.01f, z = 0;
^ This will make all the variables serialised and visible in the editor. In any wild case it doesn’t (highly unlikely, it did for me) you can always make them public like this:
public float x = 0, y = 0.01f, z = 0; //This should also be visible in the editor.
But that’s generally considered poor practice. Don’t use public variables if you can help it at all is the rule of thumb from what I know.
This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.