Discuss Scratch

QwertyCoder098
Scratcher
17 posts

Raycaster not working

I'm making a raycaster using this tutorial, but it's not working. Here's the link: https://scratch.mit.edu/projects/617569881/editor/



when green flag clicked
if <kumquat detected?> then
defend signature from kumquats
end
Jareddddddd
Scratcher
1000+ posts

Raycaster not working

in your casting scripts, where it casts the rays (wall sensing sprite), it only takes the current player direction and adds the angle offset. The script for setting the current direction should be outside the (repeat 96) loop, and inside should be a
turn cw (1) degrees
after the repeat until loop
QwertyCoder098
Scratcher
17 posts

Raycaster not working

Jareddddddd wrote:

in your casting scripts, where it casts the rays (wall sensing sprite), it only takes the current player direction and adds the angle offset. The script for setting the current direction should be outside the (repeat 96) loop, and inside should be a
turn cw (1) degrees
after the repeat until loop
I did that, but it's still not working.



when green flag clicked
if <kumquat detected?> then
defend signature from kumquats
end
QwertyCoder098
Scratcher
17 posts

Raycaster not working

Bump



when green flag clicked
if <kumquat detected?> then
defend signature from kumquats
end
PutneyCat
Scratcher
500+ posts

Raycaster not working

You have not copied the “sense” script properly.

“Go to person” and “point in direction…” should be inside the loop.

It should be change “angle offset by 1” at the end, not turn 1 degree.

By the way other tutorials are available, including this one

Powered by DjangoBB