[Solved] minetest.line_of_sight

Post Reply
User avatar
Extex
Member
Posts: 190
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

[Solved] minetest.line_of_sight

by Extex » Post

How do i check the position of the node within the line of sight?
Last edited by Extex on Sun Aug 04, 2019 23:27, edited 1 time in total.
Player of PK, RIP. Creator of the light_tool and motorbike mods. Working on another mod which should be coming soon!

User avatar
duane
Member
Posts: 1653
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: minetest.line_of_sight

by duane » Post

Extex wrote:How do i check the position of the node within the line of sight?
https://github.com/minetest/minetest/bl ... .txt#L4297
Believe in people and you don't need to believe anything else.

User avatar
Extex
Member
Posts: 190
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: minetest.line_of_sight

by Extex » Post

I know but how do I make it return the pos?
All it does for me is return the boolean
Am I doing something wrong?

local view = minetest.line_of_sight(pos, new_pos, 1)
Player of PK, RIP. Creator of the light_tool and motorbike mods. Working on another mod which should be coming soon!

User avatar
AiTechEye
Member
Posts: 858
Joined: Fri May 29, 2015 21:14
GitHub: AiTechEye
Location: ¯\_(ツ)_/¯

Re: minetest.line_of_sight

by AiTechEye » Post

local a,b = minetest.line_of_sight(pos1, pos2)

User avatar
Extex
Member
Posts: 190
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Solved] minetest.line_of_sight

by Extex » Post

Thanks it worked!
Player of PK, RIP. Creator of the light_tool and motorbike mods. Working on another mod which should be coming soon!

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests