What is the difference between the OnValidate method and attributes?

I have been watching more tutorials and reading up to increase my knowledge, but there is a lot I don’t know!

I came across these two different things and noticed they were used for constraining what code can do. Are they related or I am totally off base here?

Hi,

That’s expected. Unity is very complex. :slight_smile:

I came across these two different things and noticed they were used for constraining what code can do. Are they related or I am totally off base here?

Generally, if you read or saw something somewhere, it would be great if you could share a link to allow other people to see/read the same as you. At the moment, I don’t know what you mean by OnValidate and attributes.

In the context of Unity, the difference is fairly obvious if you just take a look at the docs:

If you don’t see any difference, please let us know why you think they are the same or do the same.

1 Like

Privacy & Terms