C
C#4mo ago
Maujey

How to use ExtensionMethods for structs

No description
No description
4 Replies
Marvin
Marvin4mo ago
Extension methods only work on instances and cannot be used in a static context like you are trying to.
Maujey
MaujeyOP4mo ago
is there any other way around it?
Marvin
Marvin4mo 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
MaujeyOP4mo ago
sure thanks!
Want results from more Discord servers?
Add your server