nicklockwood / RetroRampage

Tutorial series demonstrating how to build a retro first-person shooter from scratch in Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Operator argument #2 must precede operator argument #1

GregerSundvall opened this issue · comments

Hi and thanks for this awesome tutorial! It's a great project and I really like how you're presenting it.
I've run into a problem a bunch of times though that i really dont get. I'm somewhere in the beginning of part 3 now and i'm told to enter
player.direction = input.velocity / length in world.update.
byt that gives me the error
Operator argument #2 must precede operator argument #1
I've gotten this a few times before and then i've been able to flip it around since it's been multiplication. This time however it's division so i can't flip it.
I've googled the error without finding anything but I'm pretty new to coding so maybe it's just me...

I had screwed up in the vector calculation functions. After all the troubleshooting i've done, of course I had to find it right after I posted...