C
C#2mo ago
Maujey

How to use ExtensionMethods for structs

No description
No description
4 Replies
Marvin
Marvin2mo ago
Extension methods only work on instances and cannot be used in a static context like you are trying to.
Maujey
Maujey2mo ago
is there any other way around it?
Marvin
Marvin2mo ago
Now there are two paths you could take, make it so you call velocity = velocity.ClampLength(MAX_SPEED) or have a static helper class velocity = Vector3Helper.ClampLength(velocity, MAX_SPEED). And probably some other options too
Maujey
Maujey2mo ago
sure thanks!
Want results from more Discord servers?
Add your server