Hey!
I'm following 3DSage's tutorial and I could solve some issues with the code just fine, and i've managed to make it work. However, sometimes the ray is fired backwards:
the yellow dash is the player's direction. I think the issue might be caused by the snippets and conditionals regarding to wheter the ray is facing left-right-up-down with given angle since it always happens at the same angle range, but I can't pinpoint the cause!
About the code, i'm casting both horizontal and vertical checks separately because i'm using windows defeault notepad and it tends to get a bit messy...
Thanks in advance for your input!
-EDIT-
Hey guys! I've managed it out.
In function raycastV() the line rx = math.floor((py / 64)) * 64 - 1 should be rx = math.floor((px / 64)) * 64 - 1. I just wrote it wrong!
I'm uploading the correct code incase someone is interested in casting rays.
Raycaster firing backwards [Solved]
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 1
- Joined: Thu Jan 25, 2024 6:25 pm
Raycaster firing backwards [Solved]
- Attachments
-
- main.lua
- (3.29 KiB) Downloaded 166 times
Last edited by Andersonreis42 on Fri Jan 26, 2024 12:30 pm, edited 1 time in total.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 2 guests