0 votes

Hello !

Problem description

I am doing some simple game with fire and fire extinguisher objects. Both are made from particles 3D scenes. Also both objects are placed in VR world. I am able to pick up Fire extinguisher from ground with object pickable interactions.

Fire extinguisher

enter image description here
Gasnica drzewa

Fire

enter image description here
enter image description here

Purpose of the Question

What i am trying to achive is to make a interaction between those systems, that fire will gradually dissapear after i move area of fire extinguisher to it. Is there any good method that i should write in GDscrpt or maybe is there any good workaround to this ?

Thanks for any advices

EDITED:

I managed to do this. The idea is really simple but iam not pro in scripting or giving reference signals to nodes. I have made simple area3D into fire extinguisher which is located in front of fire extinguisher barrel and also the same things for fire. When those areas are crossing each other then the area is hide()

func _on_Extinguishing_area_area_entered(area):
        area.hide()

For those who are not familiar with scripting: First thing is to attach script to area which is hiding all those areas that we wanted to be hided.

Godot version 3.3 stable
in Engine by (17 points)
edited by

1 Answer

0 votes

I never actually tried this, but been thinking on similar problem lately.

I would make both fire and extinguisher dust as area3ds with scripted expansion behavior. This behavior would expand and direct collision shapes, as well as particles point distribution ( Points emission mode ). Collision script will let You make proper interractions.

Pozdrawiam ;)

by (5,659 points)

Yea ! I discovered somewhere that it should be made with areas3d node type. When i grab
extinguisher and after clicked trigger then the extinguisher dust should - lets say - delete the fire. I have made those areas in those to systems but I do not know how to script those properly. In the xr-tools library made by Baastian Olijj https://github.com/GodotVR/godot-xr-tools there is a function nodes for objects like this fire extinguisher which allows to grab object with controllers. I know that i need to extend this script specifically for this device. But I am not familiar with Gdscript ;/
Tahnks for any help ! ;)
Pozdrawiam ;)

You mean You code in other language or You are only familiar with editor itself and no programming language ?

I have no idea how to extinguish this fire from the GDscript point of view. What methods should i use to do it ;(

First you have to create fire and extinguisher foam, particles will just be visual representation of these. I can't write whole script for You, You will have to dig into it anyway :). There are a lot of ways to do this. One way would be use polygonal collision shape for mor static area like fire, subdivide it into segments and code behavior on collision to erase or resize own shape until no longer colliding with extinguishing dust area.

You will surely have to learn about collisions, signals, geometry shape operations, particles point distribution, dictionaries. Particles itself will never detect collisions, they provide no feedback at all, because they are extensions of shaders, that run on GPU logic.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.