Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
(since godot display everything through viewports, it allow you to use the same code be it in split screen or a in-game display like in-game -àla Quake4/DOOM-)
But if you only cast rays, you won't get anything, so you need to get a variable with get_world().direct_space_state to directly adress the physics server, then you can use the method intersect_ray() of the physics server, intersect_ray need 2 Vector3, one the origin, another one the direction.
intersect_ray will then return a dictionnary, which contain things like RID, collider's ID, collider and such, search the doc under PhysicsDirectStateSpace for more info on the method.
LPT: multiplying project_ray_normal by at least the value of your camera-mesh distance is important, otherwise, you won't hit anything.
Steps:
https://preview.ibb.co/j2r8pH/Screenshot_from_2018_04_27_18_57_11.png
I can use it to knock down objects
https://image.ibb.co/nCWxic/Screenshot_from_2018_04_27_18_57_14.png
It tracks my mouse location excactly.
https://image.ibb.co/kTjuUH/Screenshot_from_2018_04_27_18_57_22.png
Even when the camera is moving.