<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Godot Engine - Q&amp;A - Recent questions and answers</title>
<link>https://godotengine.org/qa/qa</link>
<description>Powered by Question2Answer</description>
<item>
<title>C# IsInsideTree wait for script to load</title>
<link>https://godotengine.org/qa/97554/c%23-isinsidetree-wait-for-script-to-load</link>
<description>&lt;p&gt;Im calling a function which needs to check if its NOT inside Scene tree &lt;code&gt;IsInsideTree&lt;/code&gt; then call self &lt;code&gt;_Ready()&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;E.g. you would do this in Gdscript:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;func some_function(text: String) -&amp;gt; void:
    bbcode_text = text
    if not is_inside_tree():
        yield(self, &quot;ready&quot;)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;What would be equivalent of the above code in C# (csharp)&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97554/c%23-isinsidetree-wait-for-script-to-load</guid>
<pubDate>Tue, 09 Mar 2021 15:52:06 +0000</pubDate>
</item>
<item>
<title>Answered: Why is CollisionShape2D still disabled after set back to false</title>
<link>https://godotengine.org/qa/97490/why-is-collisionshape2d-still-disabled-after-set-back-false?show=97553#a97553</link>
<description>&lt;p&gt;So it never detects collision with player, but is never disabled according to print ?&lt;br&gt;
Check if collision layers are befitting collision masks&lt;/p&gt;
</description>
<category>Projects</category>
<guid isPermaLink="true">https://godotengine.org/qa/97490/why-is-collisionshape2d-still-disabled-after-set-back-false?show=97553#a97553</guid>
<pubDate>Tue, 09 Mar 2021 15:46:51 +0000</pubDate>
</item>
<item>
<title>Autoload a resource file?</title>
<link>https://godotengine.org/qa/97549/autoload-a-resource-file</link>
<description>&lt;p&gt;Can we autoload a resource file with extension &lt;code&gt;.tres&lt;/code&gt;?&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97549/autoload-a-resource-file</guid>
<pubDate>Tue, 09 Mar 2021 14:50:04 +0000</pubDate>
</item>
<item>
<title>Import (new) animations from blender to godot ??</title>
<link>https://godotengine.org/qa/97548/import-new-animations-from-blender-to-godot</link>
<description>&lt;p&gt;I have an already animated character in godot that I made in Blender and now I want to import a new animation to it, but I don't want to have to re-apply all new physics and scripts because it's just a pain in the ass can some one please help, I thought this would be a way more common problem for people when adding new features and animations into their games.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97548/import-new-animations-from-blender-to-godot</guid>
<pubDate>Tue, 09 Mar 2021 14:44:30 +0000</pubDate>
</item>
<item>
<title>Answered: I want to remove 3 Colors from my Sprite with a Shader</title>
<link>https://godotengine.org/qa/97539/i-want-to-remove-3-colors-from-my-sprite-with-a-shader?show=97547#a97547</link>
<description>&lt;p&gt;Some time ago I answered a similar question:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://godotengine.org/qa/57568/shader-not-working-at-runtime&quot;&gt;https://godotengine.org/qa/57568/shader-not-working-at-runtime&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mainly the problem is the precision of the color and how the shader interprets it. So using the == comparator means that the color has to be exactly the same, and due to the floating point calculations and the precision of the shader this never happens. Then &amp;gt; and &amp;lt; are used to set a range.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;shader_type canvas_item;

uniform vec4 color1 :hint_color;
uniform vec4 color2 :hint_color;
uniform vec4 color3 :hint_color;
uniform float precision = 0.05;

vec4 replace_color(vec4 color, vec4 curr_color, float threshold){
    if((color.r + threshold &amp;gt;= curr_color.r &amp;amp;&amp;amp; color.r - threshold &amp;lt;= curr_color.r) &amp;amp;&amp;amp;
    (color.g + threshold &amp;gt;= curr_color.g &amp;amp;&amp;amp; color.g - threshold &amp;lt;= curr_color.g) &amp;amp;&amp;amp;
    (color.b + threshold &amp;gt;= curr_color.b &amp;amp;&amp;amp; color.b - threshold &amp;lt;= curr_color.b)){
        return vec4(0.0,0.0,0.0,0.0);
    }else{
        return curr_color;
    }    
}

void fragment() {
    vec4 tex = texture(TEXTURE,UV);
    tex = replace_color(color1,tex, precision);
    tex = replace_color(color2,tex, precision);
    tex = replace_color(color3,tex, precision);
    COLOR=tex;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This should work, and best if you have an unfiltered pixelart texture. Increase or decrease the precision parameter according to the range of colors you want to cover.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97539/i-want-to-remove-3-colors-from-my-sprite-with-a-shader?show=97547#a97547</guid>
<pubDate>Tue, 09 Mar 2021 14:23:20 +0000</pubDate>
</item>
<item>
<title>Answered: Is it possible to make an speech detection with Godot?</title>
<link>https://godotengine.org/qa/97509/is-it-possible-to-make-an-speech-detection-with-godot?show=97543#a97543</link>
<description>&lt;p&gt;This repository may be of some help:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/menip/godot_speech_to_text&quot;&gt;https://github.com/menip/godot_speech_to_text&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With its tutorial here:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://samuraisigma.github.io/godot-docs/doc/community/tutorials/misc/speech_to_text.html&quot;&gt;https://samuraisigma.github.io/godot-docs/doc/community/tutorials/misc/speech_to_text.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If my understanding is correct, after setting it up as described, you do do something like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;func _process(delta):
    if not queue.empty():
        string = queue.get()
        if string == &quot;test&quot;:
            test()
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97509/is-it-possible-to-make-an-speech-detection-with-godot?show=97543#a97543</guid>
<pubDate>Tue, 09 Mar 2021 14:04:34 +0000</pubDate>
</item>
<item>
<title>How &quot;p_render_buffers&quot; work?</title>
<link>https://godotengine.org/qa/97538/how-p_render_buffers-work</link>
<description>&lt;p&gt;Good afternoon. I would like to create my own rendering of 3d models in godot. &lt;br&gt;
After studying the source code, I came to the function &lt;code&gt;RendererSceneCull::_render_scene&lt;/code&gt; (&lt;code&gt;render_scene_full::2474&lt;/code&gt;). Here, some &lt;code&gt;p_render_buffers&lt;/code&gt; received from the Viewport are passed in the parameters. But this is an object of the RID class. &lt;br&gt;
How do I get a real object by this RID? And how do I access this buffer to write my image to it? How is the picture stored there anyway?&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97538/how-p_render_buffers-work</guid>
<pubDate>Tue, 09 Mar 2021 12:24:26 +0000</pubDate>
</item>
<item>
<title>Answered: Equivalent of _draw() in 3D?</title>
<link>https://godotengine.org/qa/97517/equivalent-of-_draw-in-3d?show=97536#a97536</link>
<description>&lt;p&gt;You can use ImmediateGeometry node to draw something from code.&lt;br&gt;
See &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.godotengine.org/en/stable/classes/class_immediategeometry.html&quot;&gt;https://docs.godotengine.org/en/stable/classes/class_immediategeometry.html&lt;/a&gt;&lt;br&gt;
Also, you can take a look at &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/dbp8890/line-renderer&quot;&gt;https://github.com/dbp8890/line-renderer&lt;/a&gt;&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97517/equivalent-of-_draw-in-3d?show=97536#a97536</guid>
<pubDate>Tue, 09 Mar 2021 12:14:58 +0000</pubDate>
</item>
<item>
<title>Android app crash with modules</title>
<link>https://godotengine.org/qa/97522/android-app-crash-with-modules</link>
<description>&lt;p&gt;Hey, i have a problem with modules. If i add a module in the project setting and i export it to android studio devices then the game start and crash instante. Why? &lt;br&gt;
Need help!!&lt;/p&gt;

&lt;p&gt;Thanks in advance&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97522/android-app-crash-with-modules</guid>
<pubDate>Tue, 09 Mar 2021 09:32:36 +0000</pubDate>
</item>
<item>
<title>Answered: Problem exporting for macos using the command line</title>
<link>https://godotengine.org/qa/97218/problem-exporting-for-macos-using-the-command-line?show=97515#a97515</link>
<description>&lt;p&gt;Nevermind, this was an issue on my side.&lt;/p&gt;

&lt;p&gt;Looks like the exported game on MacOS actually works, and the one exported by the linux headless (even though working) was actually wrongly bloated because I had leftover files in &lt;code&gt;~/.cache/godot&lt;/code&gt; from previous export attempts.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97218/problem-exporting-for-macos-using-the-command-line?show=97515#a97515</guid>
<pubDate>Tue, 09 Mar 2021 07:53:25 +0000</pubDate>
</item>
<item>
<title>Answered: How to get index of get_baked_points() and their locations?</title>
<link>https://godotengine.org/qa/97476/how-to-get-index-of-get_baked_points-and-their-locations?show=97514#a97514</link>
<description>&lt;p&gt;Answered here:&lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://godotengine.org/qa/97471/number-of-curve3d-baked-points-and-their-locations&quot;&gt;https://godotengine.org/qa/97471/number-of-curve3d-baked-points-and-their-locations&lt;/a&gt;&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97476/how-to-get-index-of-get_baked_points-and-their-locations?show=97514#a97514</guid>
<pubDate>Tue, 09 Mar 2021 07:41:32 +0000</pubDate>
</item>
<item>
<title>Answered: Problem with _physics_process, Invalid call to function move_torwards. In my player node.</title>
<link>https://godotengine.org/qa/97485/problem-_physics_process-invalid-function-move_torwards?show=97497#a97497</link>
<description>&lt;p&gt;You are passing a single parameter to the function:&lt;br&gt;
&lt;code&gt;velocity = velocity.move_toward(input_vector * MAX_SPEED * ACCELERATION * delta)&lt;/code&gt;&lt;br&gt;
it should go something like this:&lt;br&gt;
&lt;code&gt;velocity = velocity.move_toward(input_vector * MAX_SPEED,  ACCELERATION * delta)&lt;/code&gt;&lt;/p&gt;
</description>
<category>Projects</category>
<guid isPermaLink="true">https://godotengine.org/qa/97485/problem-_physics_process-invalid-function-move_torwards?show=97497#a97497</guid>
<pubDate>Tue, 09 Mar 2021 05:15:36 +0000</pubDate>
</item>
<item>
<title>Answered: How to return removed child?</title>
<link>https://godotengine.org/qa/97479/how-to-return-removed-child?show=97492#a97492</link>
<description>&lt;p&gt;If you save a reference to the node before deleting it, would it work?&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;func _ready ():
print_stray_nodes ()
var node_for_delete = $ Sprite
remove_child ($ Sprite)
print_stray_nodes ()
add_child (node_for_delete)
print_stray_nodes ()
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I'm not very clear about how everything happens when a node is removed from the scene, apart from the fact that there are several properties that are not very clear to me what they do, such as establishing an owner for a node. By the way, the print&lt;em&gt;stray&lt;/em&gt;nodes () function tells you which nodes are orphaned, that is, no parent outside the scene tree. It only works in debugging mode.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97479/how-to-return-removed-child?show=97492#a97492</guid>
<pubDate>Tue, 09 Mar 2021 04:43:36 +0000</pubDate>
</item>
<item>
<title>Answered: How can i change the &quot;godot game engine intro&quot; to another one?</title>
<link>https://godotengine.org/qa/97466/how-can-i-change-the-godot-game-engine-intro-to-another-one?show=97491#a97491</link>
<description>&lt;p&gt;In Project, project settings, general, application, boot splash you can change color, add image, use fullsize and filter.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97466/how-can-i-change-the-godot-game-engine-intro-to-another-one?show=97491#a97491</guid>
<pubDate>Tue, 09 Mar 2021 03:54:59 +0000</pubDate>
</item>
<item>
<title>Full documentation for AudioStreamPlayback methods?</title>
<link>https://godotengine.org/qa/97416/full-documentation-for-audiostreamplayback-methods</link>
<description>&lt;p&gt;I was looking at the &lt;a rel=&quot;nofollow&quot; href=&quot;https://godotengine.org/asset-library/asset/526&quot;&gt;Audio Generator Demo&lt;/a&gt; which references AudioStreamPlayback and its methods. I wanted to know more about this class and its methods but the &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.godotengine.org/en/stable/classes/class_audiostreamplayback.html#class-audiostreamplayback&quot;&gt;official docs page&lt;/a&gt; only contains the link to the demo linked above, nothing else. Where can I see how exactly push_frame() works and what other methods this class provides (e.g. for clearing the sample buffer).&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97416/full-documentation-for-audiostreamplayback-methods</guid>
<pubDate>Tue, 09 Mar 2021 03:23:27 +0000</pubDate>
</item>
<item>
<title>How to make a 3D physical trail</title>
<link>https://godotengine.org/qa/97441/how-to-make-a-3d-physical-trail</link>
<description>&lt;p&gt;I want a Trail3D to detect collisions, the trail is rendered on both sides and it's very similar to the trail from tron's lightcycles. I tried to instanciate Areas behind the player while it's moving, but it's not precise and having a lot of them causes lag.  &lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97441/how-to-make-a-3d-physical-trail</guid>
<pubDate>Tue, 09 Mar 2021 03:23:10 +0000</pubDate>
</item>
<item>
<title>ArrayMesh generates extra meshes</title>
<link>https://godotengine.org/qa/97436/arraymesh-generates-extra-meshes</link>
<description>&lt;p&gt;Im trying to make a procedurally generated blocky terrain game like minecraft and decided to divide the world up in chunks that are 16x16x16 blocks in size, chunks check the blocks that are present in it and creates a shell of mesh around it to optimize rendering&lt;/p&gt;

&lt;p&gt;however when i put two chunks in one scene the two creates another chunk mesh in between them that seems to be a combination of the two meshes and i have no idea why it's even doing that and when i call the createTrimeshCollision() method it counts the third mesh as a valid mesh despite no vertices present at that location&lt;/p&gt;

&lt;p&gt;note:&lt;br&gt;
a chunk scene has a child node in it that has its own script which handles all the rendering&lt;/p&gt;

&lt;p&gt;here's the code so far:&lt;/p&gt;

&lt;h2&gt;Chunk node&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;extends Spatial

var size = Vector3(16, 16, 16)
var blockSize = 2
var ChunkData = []
var topChunk: bool = false

var noise = OpenSimplexNoise.new()

onready var Renderer = $BlockRenderer
onready var meshInstance = $MeshInstance

func createChunkData():
    for _x in range(size.x):
        var zLayer = []
        for _z in range(size.z):
            var yLayer = []
            for _y in range(size.y):
                yLayer.append(1)
            zLayer.append(yLayer)
        ChunkData.append(zLayer)

func updateChunk():
    Renderer.verts = PoolVector3Array()
    Renderer.normals = PoolVector3Array()
    createChunk()

func createChunk():
    var pos = translation
    for x in range(len(ChunkData)):
        for z in range(len(ChunkData[x])):
            for y in range(len(ChunkData[x][z])):
                var BlockPos = Vector3(pos.x + x * 2, pos.y + y * 2, pos.z - z * 2)

                if ChunkData[x][z][y] != 0:
                    if x == 0:
                        Renderer.AddLeftFace(BlockPos)
                    if x == 15:
                        Renderer.AddRightFace(BlockPos)
                    if z == 0:
                        Renderer.AddFrontFace(BlockPos)
                    if z == 15:
                        Renderer.AddBackFace(BlockPos)
                    if y == 0:
                        Renderer.AddBottomFace(BlockPos)
                    if y == 15:
                        Renderer.AddTopFace(BlockPos)

                    if x - 1 &amp;gt;= 0 and ChunkData[x - 1][z][y] == 0:
                        Renderer.AddLeftFace(BlockPos)
                    if x + 1 &amp;lt; 16 and ChunkData[x + 1][z][y] == 0:
                        Renderer.AddRightFace(BlockPos)
                    if z - 1 &amp;gt;= 0 and ChunkData[x][z - 1][y] == 0:
                        Renderer.AddFrontFace(BlockPos)
                    if z + 1 &amp;lt; 16 and ChunkData[x][z + 1][y] == 0:
                        Renderer.AddBackFace(BlockPos)
                    if y - 1 &amp;gt;= 0 and ChunkData[x][z][y - 1] == 0:
                        Renderer.AddBottomFace(BlockPos)
                    if y + 1 &amp;lt; 16 and ChunkData[x][z][y + 1] == 0:
                        Renderer.AddTopFace(BlockPos)
    Renderer.DrawMesh(meshInstance)
    meshInstance.create_trimesh_collision()
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Renderer child node&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;extends Node

var verts = PoolVector3Array()
var normals = PoolVector3Array()

var arr = []

var VertData = [
    Vector3(0, 0, 0),
    Vector3(0, 2, 0),
    Vector3(2, 2, 0),
    Vector3(2, 0, 0),

    Vector3(0, 0, -2),
    Vector3(0, 2, -2),
    Vector3(2, 2, -2),
    Vector3(2, 0, -2)
]
var IndexData = [
    0, 1, 2,
    0, 2, 3,

    4, 5, 1,
    4, 1, 0,

    7, 6, 5,
    7, 5, 4,

    3, 2, 6,
    3, 6, 7,

    1, 5, 6,
    1, 6, 2,

    4, 0, 3,
    4, 3, 7
]

func AddFrontFace(pos: Vector3):
    for i in range(6):
        verts.push_back(VertData[IndexData[i]] + pos)

    for _i in range(6):
        normals.push_back(Vector3.FORWARD)

func AddLeftFace(pos: Vector3):
    for i in range(6, 12):
        verts.push_back(VertData[IndexData[i]] + pos)

    for _i in range(6):
        normals.push_back(Vector3.LEFT)

func AddBackFace(pos: Vector3):
    for i in range(12, 18):
        verts.push_back(VertData[IndexData[i]] + pos)

    for _i in range(6):
        normals.push_back(Vector3.BACK)

func AddRightFace(pos: Vector3):
    for i in range(18, 24):
        verts.push_back(VertData[IndexData[i]] + pos)

    for _i in range(6):
        normals.push_back(Vector3.RIGHT)

func AddTopFace(pos: Vector3):
    for i in range(24, 30):
        verts.push_back(VertData[IndexData[i]] + pos)

    for _i in range(6):
        normals.push_back(Vector3.UP)

func AddBottomFace(pos: Vector3):
    for i in range(30, 36):
        verts.push_back(VertData[IndexData[i]] + pos)

    for _i in range(6):
        normals.push_back(Vector3.DOWN)

func DrawMesh(mesh: MeshInstance):
    var m = mesh.mesh
    arr.resize(ArrayMesh.ARRAY_MAX)

    arr[ArrayMesh.ARRAY_VERTEX] = verts
    arr[ArrayMesh.ARRAY_NORMAL] = normals

    m.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arr)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;if im doing anything that is question worthy despite it not being related to the question do tell me anyway i'd like to improve and get better at making 3D games regardless&lt;/p&gt;
</description>
<category>Projects</category>
<guid isPermaLink="true">https://godotengine.org/qa/97436/arraymesh-generates-extra-meshes</guid>
<pubDate>Tue, 09 Mar 2021 03:23:07 +0000</pubDate>
</item>
<item>
<title>Physical trail</title>
<link>https://godotengine.org/qa/97437/physical-trail</link>
<description>&lt;p&gt;I'm making a clone of tron, I'm using the Godot Trail System to leave a trail behind the player.&lt;br&gt;
I just want to make the trail physical so that players die if they collide with it, I looked in the inspector of the Trail3D and I couldn't find anything helpful.&lt;br&gt;
The Trail3D node is a child of the player node, I only set the segments number, the lifetime and the material.&lt;br&gt;
I'm a beginner so I can't find a solution that works for me.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97437/physical-trail</guid>
<pubDate>Tue, 09 Mar 2021 03:22:56 +0000</pubDate>
</item>
<item>
<title>Answered: My character only scales one way.</title>
<link>https://godotengine.org/qa/97438/my-character-only-scales-one-way?show=97489#a97489</link>
<description>&lt;p&gt;I dont know what the abs() function does because i've never used it before but i've made a 2D platformer before and i just set scale.x as either 1 or -1 depending on keyboard input and it works without any bugs, i honestly dont see the cause of your problem either and if the bug remains i apologize for not being much help&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97438/my-character-only-scales-one-way?show=97489#a97489</guid>
<pubDate>Tue, 09 Mar 2021 03:22:48 +0000</pubDate>
</item>
<item>
<title>Answered: Creating a &quot;weapon wheel&quot; using an array</title>
<link>https://godotengine.org/qa/97486/creating-a-weapon-wheel-using-an-array?show=97488#a97488</link>
<description>&lt;p&gt;For the first problem, you can skip the loop step that reads the array using the continue keyword. In this case I verify that the name of the weapon is not null but it can be any condition, then I could save the results in the other array.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var guns= ['ak','','pistol']
func _ready():
    for g in guns:
        if g == &quot;&quot;:
            continue
        print(g)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For the second question, the array class has an insert method, which given an index and the data, inserts the data in that index updating the indexes of the following elements. The idea that they appear darkened and unselectable is fine, like the csgo menu. Another idea is to use a dictionary instead of an array, since you could group several data related to each weapon: name, defaul slot, unblocked, price, etc. &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    #[name, defaul slot, unblocked, price] 
    var guns= {
            weapon_ak47 = ['AK_47', 1, true, 2900] ,
            weapon_awp = ['AWP' , 3 , false, 4900]
   }

        func _ready():
            #for g in guns.values():
                #print(g)

            #guns.weapon_ak47[2] = false    

            #for g in guns.values():
                #print(g)

            for g in guns.values():
                if g[2] == false:
                    continue
                print(g)        
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;There are several ways, if you work with dictionaries, read the documentation carefully since in certain cases it can generate confusion, especially if you nest a lot of data or other dictionaries.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97486/creating-a-weapon-wheel-using-an-array?show=97488#a97488</guid>
<pubDate>Tue, 09 Mar 2021 01:18:36 +0000</pubDate>
</item>
<item>
<title>Answered: How would I go about making a sprites animation for shooting change based on the mouse position.</title>
<link>https://godotengine.org/qa/97335/would-about-making-sprites-animation-shooting-change-position?show=97484#a97484</link>
<description>&lt;p&gt;Is this a side-scroller or a top-down view game?&lt;/p&gt;

&lt;p&gt;You could always use a separate sprite for the &quot;arm&quot; and use the &quot;look_at()&quot; function.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97335/would-about-making-sprites-animation-shooting-change-position?show=97484#a97484</guid>
<pubDate>Mon, 08 Mar 2021 23:31:23 +0000</pubDate>
</item>
<item>
<title>Answered: how to create a 2d road</title>
<link>https://godotengine.org/qa/97445/how-to-create-a-2d-road?show=97483#a97483</link>
<description>&lt;p&gt;It would be very simple in 2D, just use sprites for the track (You could draw the whole track in a single sprite)&lt;/p&gt;

&lt;p&gt;Then, to prevent the cars from going off the track, i would use CollisionPolygon2D to make the &quot;Outside&quot; borders and another one for the &quot;Inside&quot; borders&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97445/how-to-create-a-2d-road?show=97483#a97483</guid>
<pubDate>Mon, 08 Mar 2021 23:26:46 +0000</pubDate>
</item>
<item>
<title>Answered: Number of curve3D baked points and their locations</title>
<link>https://godotengine.org/qa/97471/number-of-curve3d-baked-points-and-their-locations?show=97482#a97482</link>
<description>&lt;p&gt;get&lt;em&gt;baked&lt;/em&gt;points () is an array of positions. To count them use the property of arrays: size. I leave you a small example that duplicates a mesh and puts it in each point of the array, that is, the baked points of the curve. If you reduce the bake interval in the path properties you can see how the points increase.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;extends Spatial
var points

func _ready():
    points=$Path.curve.get_baked_points()
    print(points.size())

    for i in points:
        var a =$MeshInstance.duplicate()
        add_child(a)
        a.translation = i
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97471/number-of-curve3d-baked-points-and-their-locations?show=97482#a97482</guid>
<pubDate>Mon, 08 Mar 2021 23:13:52 +0000</pubDate>
</item>
<item>
<title>load a texture from external path</title>
<link>https://godotengine.org/qa/97478/load-a-texture-from-external-path</link>
<description>&lt;p&gt;I'm trying to try to get a texture to load from an external folder outside of the project &lt;code&gt;texture = load(&quot;C:/Users/all_a/dowloads a texture from external pathoads/texture&quot;)&lt;/code&gt;&lt;br&gt;
how do this?&lt;/p&gt;
</description>
<category>Projects</category>
<guid isPermaLink="true">https://godotengine.org/qa/97478/load-a-texture-from-external-path</guid>
<pubDate>Mon, 08 Mar 2021 20:45:38 +0000</pubDate>
</item>
<item>
<title>Weird Viewport Behavior When Resolution Changes</title>
<link>https://godotengine.org/qa/97477/weird-viewport-behavior-when-resolution-changes</link>
<description>&lt;p&gt;Hey, everyone! I'm a CanvasItem noob, and I can't for the life of me get this to work. I need to be able to change the resolution in my game, but if I do, the camera isn't centered anymore. I think the problem has to do with the ViewportContainer node. Here's my node structure:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://imgur.com/vNF0Pty&quot;&gt;https://imgur.com/vNF0Pty&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is what it looks like in the default resolution:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://imgur.com/0lSzCGP&quot;&gt;https://imgur.com/0lSzCGP&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this is what it looks like in 2x resolution (without any camera movement):&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://imgur.com/WYasMVk&quot;&gt;https://imgur.com/WYasMVk&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm changing the resolution by changing the size in the viewport. I've tried changing it by code using set&lt;em&gt;size&lt;/em&gt;override, but had the same results.&lt;br&gt;
Reading the docs and some other questions in the forums, people suggested changing the stretch project settings, but it didn't help. Here are my current settings:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://imgur.com/13wrPyO&quot;&gt;https://imgur.com/13wrPyO&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also can't remove the ViewportContainer, there's a shader associated with it.&lt;br&gt;
So, how can I change the resolution and keep the game scale and position?  :(&lt;br&gt;
Thank you so much to anyone who takes the time to answer  &amp;lt;3&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97477/weird-viewport-behavior-when-resolution-changes</guid>
<pubDate>Mon, 08 Mar 2021 20:17:44 +0000</pubDate>
</item>
<item>
<title>Godot create android plugin? Engine has no singleton!</title>
<link>https://godotengine.org/qa/97470/godot-create-android-plugin-engine-has-no-singleton</link>
<description>&lt;p&gt;Hello, i tried to make a own android plugin in Android studio and If make all what the docs say and i export the aar file to godot plugins, then i ask If the engine has Singleton then say loaded and else Not loaded. But it says not loaded and the plugin is active in the export settings.&lt;/p&gt;

&lt;p&gt;Pls help me fast.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97470/godot-create-android-plugin-engine-has-no-singleton</guid>
<pubDate>Mon, 08 Mar 2021 18:50:23 +0000</pubDate>
</item>
<item>
<title>Answered: Questions about Materials</title>
<link>https://godotengine.org/qa/97444/questions-about-materials?show=97469#a97469</link>
<description>&lt;p&gt;Getting your textures from cc0textures.com should be fine. Since they've been released into the public domain, they can be used for whatever purpose. The file format chosen shouldn't really matter as long as the resolution is consistent, i.e. a 2k JPG is just as good as a 2k PNG file. The only real difference is that PNG files support transparency.&lt;/p&gt;

&lt;p&gt;With respect to image resolution, go with one that suits the game's look. The pixels of lower res textures will be more noticeable in 4k resolutions, so going with a high resolution texture is a good idea. Though it depends on the art of the game. Just because the models have 4k textures doesn't mean the player is going to notice these high resolution textures (though I'm sure the player would appreciate such detail). One of the drawbacks of high resolution textures is that they take up a lot more space, so a balance may have to be found between higher resolution, game size, and art quality.&lt;/p&gt;

&lt;p&gt;The placement of the other materials should be fine: the normal material goes with the normal map, roughness material goes with the roughness map, and so on. &lt;a rel=&quot;nofollow&quot; href=&quot;https://godotengine.org/qa/76155/what-to-do-with-displacement-files-in-spatial-materials?show=76161#a76161&quot;&gt;This answer&lt;/a&gt; suggests putting the displacement material in the Depth attribute. As for triplanar mapping the only disadvantage I can see that the engine would do more blending on the model, and thus more processing.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97444/questions-about-materials?show=97469#a97469</guid>
<pubDate>Mon, 08 Mar 2021 18:32:37 +0000</pubDate>
</item>
<item>
<title>Answered: Background wallpaper for fullscreen mode</title>
<link>https://godotengine.org/qa/97454/background-wallpaper-for-fullscreen-mode?show=97459#a97459</link>
<description>&lt;p&gt;From what little I understand, the fullscreen mode is simulated, it creates a borderless window that adapts to the resolution of the monitor. If you test your project in the editor at a different resolution than your monitor, when you use fullscreen it will look different. In the project options where you configure fullscreen, last are the options to tell godot what to do with the content when the resolution changes. Try setting stretch / mode to 2d.&lt;br&gt;
If I remember correctly in the manual there is a section explaining how to adapt the game to multiple resolutions.&lt;br&gt;
For the background I would use a texture rect node as the first child of the scene. In its options you can scale your content, center it, keep the aspect ratio, etc.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97454/background-wallpaper-for-fullscreen-mode?show=97459#a97459</guid>
<pubDate>Mon, 08 Mar 2021 16:11:26 +0000</pubDate>
</item>
<item>
<title>Answered: How to create a loading screen</title>
<link>https://godotengine.org/qa/41325/how-to-create-a-loading-screen?show=97458#a97458</link>
<description>&lt;p&gt;So - what people need to understand about the background loading tutorial in the documentation is that is still loads everything in the main thread. It just stops between loading scenes to poll the ResourceLoader. So if you can't divide your game into a bunch of smaller scenes to load, you probably shouldn't follow that tutorial. Actually, don't follow the tutorial at all - it's pretty bad and like half of it is in C++. It's probably better to use multiple threads instead. Unfortunately you can't have load progress and multiple threads at the same time, but you can just slap a fake loading bar on the screen.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/41325/how-to-create-a-loading-screen?show=97458#a97458</guid>
<pubDate>Mon, 08 Mar 2021 15:52:56 +0000</pubDate>
</item>
<item>
<title>Answered: load routes from ConfigFile ?</title>
<link>https://godotengine.org/qa/97446/load-routes-from-configfile?show=97455#a97455</link>
<description>&lt;p&gt;Use &quot;/&quot; instead.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97446/load-routes-from-configfile?show=97455#a97455</guid>
<pubDate>Mon, 08 Mar 2021 15:23:33 +0000</pubDate>
</item>
<item>
<title>Answered: Cant use the .json files in my res:// after exporting</title>
<link>https://godotengine.org/qa/97448/cant-use-the-json-files-in-my-res-after-exporting?show=97453#a97453</link>
<description>&lt;p&gt;.json files are not exported by default. You must specify them to be exported in the Resources tab of the export menu.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97448/cant-use-the-json-files-in-my-res-after-exporting?show=97453#a97453</guid>
<pubDate>Mon, 08 Mar 2021 15:18:01 +0000</pubDate>
</item>
<item>
<title>Answered: how to make a railway using path2d</title>
<link>https://godotengine.org/qa/97363/how-to-make-a-railway-using-path2d?show=97452#a97452</link>
<description>&lt;p&gt;path2d uses a 2d curve for the points. I would create the sprites with the different directions of the rail and I would put each sprite as a child position2d at the ends where I want them to connect. Then I would use the path functions to add points to the curve where the position2d in the sprites are. Another more suitable way (although I never use it) is to use tilemap, each tile can be assigned navigation. The tiles can be created ingame and you only have to worry about checking that the tiles to be joined are the correct ones according to the rail check this video:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.youtube.com/watch?v=0fPOt0Jw52s&amp;amp;ab_channel=GDQuest&quot;&gt;https://www.youtube.com/watch?v=0fPOt0Jw52s&amp;amp;ab_channel=GDQuest&lt;/a&gt;&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97363/how-to-make-a-railway-using-path2d?show=97452#a97452</guid>
<pubDate>Mon, 08 Mar 2021 15:15:47 +0000</pubDate>
</item>
<item>
<title>Answered: What's the use of Rect2.end</title>
<link>https://godotengine.org/qa/97442/whats-the-use-of-rect2-end?show=97449#a97449</link>
<description>&lt;p&gt;If the rectangle starts at position (0,0) of the parent, and we assign 100 width and 100 height, end will mark the end of the rectangle with respect to the parent position, in this case it will be (100,100). If we now move the rectangle to position (10,10), the rectangle will still have 100 width and 100 height but now end will mark (110,110). Note that the size can go negative, that is, the rectangle can be expanded to the right (width +), left (width-), down (height +), or up (height-).You can draw a rectangle in _draw () to see how they behave.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;but it doesnt multiply the size for the units amount if I add size * 8&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I do not understand this. Where does the 8 come from? Is the size of your tiles?  If you know the position of the object and the edge you can use the &lt;code&gt;Vector2.DistanceTo&lt;/code&gt; function to find out the distance in pixels and then divide that distance by the width of the tile.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97442/whats-the-use-of-rect2-end?show=97449#a97449</guid>
<pubDate>Mon, 08 Mar 2021 14:32:42 +0000</pubDate>
</item>
<item>
<title>Impossible to process image from clipboard or take screenshot of desktop.</title>
<link>https://godotengine.org/qa/97439/impossible-process-image-from-clipboard-screenshot-desktop</link>
<description>&lt;p&gt;Hello. I made an app that analyzes imported fragment from another app, performs some measurements and saves it to the log. The whole process is quite bothersome at the moment as it requires user to save a screenshot on the disk, open it in explorer, drag&amp;amp;drop onto my program and then delete that image. Every time.&lt;br&gt;
I was thinking of any way to ease this part by using screencap software to save a fragment in the clipboard and grab it from there, but the only related method &lt;em&gt;OS.get_clipboard()&lt;/em&gt; doesn't work with anything but strings.&lt;br&gt;
Another thought was to make a desktop screenshot from the app itself via hotkey and manually select a region to work with but I could hardly find any discussion on this topic and it seems that such functionality isn't even present in godot for reasons.&lt;/p&gt;

&lt;p&gt;Is there any other way to process system's screen region without saving it as image file? Any side libraries?&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97439/impossible-process-image-from-clipboard-screenshot-desktop</guid>
<pubDate>Mon, 08 Mar 2021 11:36:38 +0000</pubDate>
</item>
<item>
<title>Answered: Visualize a selected part of the UI - similar to the ItemList, but without using it</title>
<link>https://godotengine.org/qa/97343/visualize-selected-part-the-similar-itemlist-without-using?show=97435#a97435</link>
<description>&lt;p&gt;As @tripod mentioned, there is a rather simple workaround, however I disliked another hacky approach like things I did before. So i decided to use his second idea which (after some trial and error) worked perfectly: Using themes themselves.&lt;/p&gt;

&lt;p&gt;First off, I had to create a new special theme for one of the entries in the &lt;code&gt;LayerContainer&lt;/code&gt;. Note here that an inherited theme (from a node aboce) could not be found here. Explicitly set the a theme into this entry-node. &lt;/p&gt;

&lt;p&gt;In this theme, as stated by tripod &quot;add a custom StyleBox for focus&quot;, in my case i called it &quot;FocusedBox&quot;. Then &quot;in the _draw() method, check for focus and render the focus box&quot; like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;func _draw():
         if has_focus():
        var focussed = theme.get_stylebox(&quot;FocusedBox&quot;, &quot;BoxContainer&quot;)
        draw_style_box(focussed, Rect2(Vector2(0,0), rect_size))&lt;/code&gt;&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97343/visualize-selected-part-the-similar-itemlist-without-using?show=97435#a97435</guid>
<pubDate>Mon, 08 Mar 2021 10:20:26 +0000</pubDate>
</item>
<item>
<title>Answered: What is the difference between PopupPanel and PopupDialog</title>
<link>https://godotengine.org/qa/97308/what-is-the-difference-between-popuppanel-and-popupdialog?show=97432#a97432</link>
<description>&lt;p&gt;&lt;em&gt;PopupPanel&lt;/em&gt; and &lt;em&gt;PopupDialog&lt;/em&gt; both inherit from Popup, so their functionality is very similar. &lt;/p&gt;

&lt;p&gt;The main difference is that &lt;em&gt;PopupPanel&lt;/em&gt; uses a panel as part of its structure. If you need to put some text in it for example, it would fit a lot better than in PopupDialogue.  If you wanted more control over your popup, it would be better to use &lt;em&gt;PopupDialogue&lt;/em&gt; (which provides a background which you can control the style of via the theme) or simply the &lt;em&gt;Popup&lt;/em&gt; class.&lt;/p&gt;

&lt;p&gt;You can see below for a visual comparison of the nodes. Each one contains a single RichTextEdit:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/bj6UhLR.png&quot; alt=&quot;Popup Comparison&quot;&gt;&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97308/what-is-the-difference-between-popuppanel-and-popupdialog?show=97432#a97432</guid>
<pubDate>Mon, 08 Mar 2021 09:47:08 +0000</pubDate>
</item>
<item>
<title>How to make a Procedural Generator for a simple Circular Tilemap?</title>
<link>https://godotengine.org/qa/97424/how-make-procedural-generator-for-simple-circular-tilemap</link>
<description>&lt;p&gt;for practice I'm trying to make a clone of the game Loop hero.&lt;/p&gt;

&lt;p&gt;I have most things done but I don't know how to make the procedural generated path that loops around in a nice way.&lt;/p&gt;

&lt;p&gt;My best idea is to designate a starting point and create tiles in one direction with small random chances to turn perpendicular to that direction and keep going on the original direction once close to the edge of the zone force a turn and repeat 4 times. To make it  wrap around my idea was to check for the position of the starting point on the &quot;third forced direction turn&quot; and with a lot of if statements match the position tile by tile.&lt;/p&gt;

&lt;p&gt;Is there an easy way to do this? or should I try to implement the above?&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97424/how-make-procedural-generator-for-simple-circular-tilemap</guid>
<pubDate>Mon, 08 Mar 2021 08:51:03 +0000</pubDate>
</item>
<item>
<title>Answered: Why godot 4 more heavily and lagging than godot 3 ?</title>
<link>https://godotengine.org/qa/97370/why-godot-4-more-heavily-and-lagging-than-godot-3?show=97423#a97423</link>
<description>&lt;p&gt;Will be slow if you compile  with debug flag&lt;/p&gt;

&lt;p&gt;But with release_debug , or release will be much faster&lt;/p&gt;

&lt;p&gt;For more info back to docs about compiling the engine&lt;/p&gt;

&lt;p&gt;Anyway, godot 4 still and heavy development &lt;/p&gt;

&lt;p&gt;So don’t except its gonna be ready to use... it’s unstable at all&lt;/p&gt;

&lt;p&gt;Best regards &lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97370/why-godot-4-more-heavily-and-lagging-than-godot-3?show=97423#a97423</guid>
<pubDate>Mon, 08 Mar 2021 08:37:53 +0000</pubDate>
</item>
<item>
<title>Answered: Line drawn through Line.add.point disappearing after finite time</title>
<link>https://godotengine.org/qa/97380/line-drawn-through-line-point-disappearing-after-finite-time?show=97392#a97392</link>
<description>&lt;p&gt;You have too many points in your Line2D! As stated in the docs &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.godotengine.org/en/stable/classes/class_line2d.html&quot;&gt;here&lt;/a&gt;,&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;By default, Godot can only draw up to 4,096 polygon points at a time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Try only adding points when velocity is not zero to reduce the number of points you draw.&lt;/p&gt;
</description>
<category>Projects</category>
<guid isPermaLink="true">https://godotengine.org/qa/97380/line-drawn-through-line-point-disappearing-after-finite-time?show=97392#a97392</guid>
<pubDate>Mon, 08 Mar 2021 02:50:58 +0000</pubDate>
</item>
<item>
<title>Answered: Block event after touching TouchScreenButton</title>
<link>https://godotengine.org/qa/96880/block-event-after-touching-touchscreenbutton?show=97390#a97390</link>
<description>&lt;p&gt;I got the same issue with raycasting and a button event, to solve this issue for me I created a timer into raycasting process so you can press a button and call a method to avoid raycasting event. As a raycasting happens first, I exposed a method for calling later from my GUI in this case a button event. The timer is just a pause to wait if it can avoid the raycasting.&lt;/p&gt;

&lt;p&gt;I did these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Raycasting happens from a camera.&lt;/li&gt;
&lt;li&gt;I created a timer in a camera script this for doing a pause (I used 0.2 seconds).&lt;/li&gt;
&lt;li&gt;A button event can release over your GUI and later this calls a method from your camera script to avoid a raycasting with a flag variable.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I solved this issue for my 3D game and it works now. Also I am searching a better way to solve this issue more elegant.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/96880/block-event-after-touching-touchscreenbutton?show=97390#a97390</guid>
<pubDate>Mon, 08 Mar 2021 01:12:02 +0000</pubDate>
</item>
<item>
<title>For a 3d game rendered at low resolution, how would you make a Subpixel Camera?</title>
<link>https://godotengine.org/qa/97389/for-game-rendered-low-resolution-would-make-subpixel-camera</link>
<description>&lt;p&gt;For reference, &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.youtube.com/watch?v=NutO1jzuVXU&amp;amp;ab_channel=t3ssel8r&quot;&gt;this&lt;/a&gt; is the effect I'm trying to create.&lt;/p&gt;

&lt;p&gt;Here's the minimal working &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/jscul/godot-pixel-perfect-camera&quot;&gt;GitHub repository&lt;/a&gt; to replicate the problem.&lt;/p&gt;

&lt;p&gt;The reason this doesn't work in my game right now is the camera moves with the player. Meaning that (due to 3d physics and the fact the player occupies space between pixels) I need to translate the camera to a place where all 3d objects (sprites) will render the same without jitter. I'm getting close but I'm not quite there.&lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://imgur.com/a/VYEfMAs&quot;&gt;Here are the camera settings&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here's my proposed solution:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Attach Camera to the Player (which moves in subpixel 3d space).&lt;/li&gt;
&lt;li&gt;Create a script for all movable objects and the camera to &quot;snap pixel&quot; offset the sprite/camera relative to the parent given the global transform of the parent. Static objects don't need this because they'll be adjusted via adjusting the camera.&lt;/li&gt;
&lt;li&gt;Render w/ size 360x240.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The code formatting is bad in Godot. But the relevant script can be found &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/jscul/godot-pixel-perfect-camera/blob/main/lib/pixel_perfect.gd&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'm extremely close with this solution, but there's still jitter on static non-moving 3d objects in my scene. I'm wondering if there's a better way to do this or if I'm fighting an unwinnable battle. It seems like if you can do it in Unity, you should be able to do it in Godot too.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97389/for-game-rendered-low-resolution-would-make-subpixel-camera</guid>
<pubDate>Mon, 08 Mar 2021 01:10:24 +0000</pubDate>
</item>
<item>
<title>Answered: Get mouse position relative to camera?</title>
<link>https://godotengine.org/qa/78389/get-mouse-position-relative-to-camera?show=97338#a97338</link>
<description>&lt;p&gt;I used mine as:&lt;br&gt;
$Weapon.look&lt;strong&gt;at(get&lt;/strong&gt;local&lt;strong&gt;mouse&lt;/strong&gt;position())&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/78389/get-mouse-position-relative-to-camera?show=97338#a97338</guid>
<pubDate>Sun, 07 Mar 2021 20:51:48 +0000</pubDate>
</item>
<item>
<title>Lag when I'm running debug</title>
<link>https://godotengine.org/qa/97344/lag-when-im-running-debug</link>
<description>&lt;p&gt;So I'm new to godot engine and already learned some basics. I just made a quick top down shooter. When I run debug it's normally about 120 fps, but after 5 seconds it goes to 2 fps. Does someone know hot to fix this?&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97344/lag-when-im-running-debug</guid>
<pubDate>Sun, 07 Mar 2021 20:51:44 +0000</pubDate>
</item>
<item>
<title>2D top-down point and click navigation</title>
<link>https://godotengine.org/qa/97367/2d-top-down-point-and-click-navigation</link>
<description>&lt;p&gt;Map is 2d top-down composed of TileMap with two tile types: wall and floor. Walls have a square collision polygon, floor tiles are just sprites. Tile cell size is 16x16px.&lt;/p&gt;

&lt;p&gt;Player is a KinematicBody2D, containing circle CollisionShape2D of 16px radius, with point and click movement. Pathfinding is done through TileMap by AStar class.&lt;/p&gt;

&lt;p&gt;Issue is that path Point can be 8px close to the Wall and Player center is 16px away from Wall. I solved this issue by calculating Plane from collision point and normal and&lt;br&gt;
moving Point away from Wall. Now moving parallel to the Wall is more or less fine. But this doesn't solve moving around corner and over top of the Wall. The collision normal&lt;br&gt;
in this points are weirdly angled and doesn't correspond with Wall surface normal Player hitting. This makes Player &quot;bounce&quot; up and down moving around the thin Wall bits.&lt;/p&gt;

&lt;p&gt;So my question is if there is a way to get surface normal of collided Wall? Or may be I'm getting wrong way about this and there is a completely different solution to my whole problem?&lt;br&gt;
&lt;img src=&quot;https://i.postimg.cc/N0gGMBVQ/nav-problem.png&quot; alt=&quot;Screenshot&quot;&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;func move_along(delta):
var point = get_point()
if !point: return
if position.distance_to(point) &amp;lt; 1:
    next_point()
    return

var velocity = (point - position).normalized() * move_speed
var collision = move_and_collide(velocity * delta)

if collision:
    # https://docs.godotengine.org/en/stable/tutorials/math/vectors_advanced.html#doc-vectors-advanced
    # Distance from the Origin to the collision Plane
    var D = collision.normal.dot(collision.position)
    # distance from Point to Plane
    var ptp = collision.normal.dot(point) - D
    # Offset - how far to move Point from the Plane:
    # distance from Body center to Plane minus distance from Point to Plane
    var offset = position.distance_to(collision.position) - ptp
    var offset_vector = collision.normal * (offset + 0.1)
    var new_point = offset_vector + point

    if ptp &amp;gt; 0:
        next_point(new_point)
    else:
        add_intermediate_point(new_point)
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97367/2d-top-down-point-and-click-navigation</guid>
<pubDate>Sun, 07 Mar 2021 20:51:18 +0000</pubDate>
</item>
<item>
<title>Answered: Know whether the node is running in the editor or in game</title>
<link>https://godotengine.org/qa/97382/know-whether-the-node-is-running-in-the-editor-or-in-game?show=97383#a97383</link>
<description>&lt;p&gt;Try using &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.godotengine.org/en/stable/classes/class_os.html#class-os-method-has-feature&quot;&gt;OS.has_feature(&quot;editor&quot;)&lt;/a&gt;.&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97382/know-whether-the-node-is-running-in-the-editor-or-in-game?show=97383#a97383</guid>
<pubDate>Sun, 07 Mar 2021 18:39:45 +0000</pubDate>
</item>
<item>
<title>Answered: Make a own game enigne with godot?</title>
<link>https://godotengine.org/qa/97124/make-a-own-game-enigne-with-godot?show=97381#a97381</link>
<description>&lt;p&gt;Of course you can! But maybe you should be more specific with your question.&lt;/p&gt;

&lt;p&gt;For example, you can create a base of side scrolling platform game and create games using it just tweaking, a game like Mario, Megaman, Metal Slug, etc. That's an engine&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97124/make-a-own-game-enigne-with-godot?show=97381#a97381</guid>
<pubDate>Sun, 07 Mar 2021 18:13:04 +0000</pubDate>
</item>
<item>
<title>Answered: how to make friendly AI</title>
<link>https://godotengine.org/qa/97178/how-to-make-friendly-ai?show=97379#a97379</link>
<description>&lt;p&gt;Just create a nice AI&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97178/how-to-make-friendly-ai?show=97379#a97379</guid>
<pubDate>Sun, 07 Mar 2021 18:05:10 +0000</pubDate>
</item>
<item>
<title>Answered: Get mouse click position on the editor canvas</title>
<link>https://godotengine.org/qa/97362/get-mouse-click-position-on-the-editor-canvas?show=97374#a97374</link>
<description>&lt;p&gt;Ok, I think I managed to do as:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;onready var current_object: MyClass = null
func forward_canvas_gui_input(event):
    if event is InputEventMouseButton:
        var mouse_pos = current_texture.get_local_mouse_position()
        assert current_object is MyClass
        assert current_object.has_method(&quot;pass_click&quot;)
        current_object.field = mouse_pos
    return false

func handles(object):
if object is MyClass:
        current_object = object
    return object is MyClass
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;However, when I tried to pass the information through a method (and not a field), I got:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Invalid call. Nonexistent function 'pass_click' in base 'TextureRect (MyTR.gd)'.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;My script looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class_name MyClass
extends TextureRect

export var field = 7
func pass_click(event):
    print(&quot;got event&quot;, event)
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97362/get-mouse-click-position-on-the-editor-canvas?show=97374#a97374</guid>
<pubDate>Sun, 07 Mar 2021 17:26:52 +0000</pubDate>
</item>
<item>
<title>How do I fix my code for making the attacks appear at random positions?</title>
<link>https://godotengine.org/qa/97373/how-fix-code-for-making-the-attacks-appear-random-positions</link>
<description>&lt;p&gt;I used this code:&lt;br&gt;
extends Area2D&lt;/p&gt;

&lt;p&gt;var rand = RandomNumberGenerator.new()&lt;/p&gt;

&lt;p&gt;onready var attacksprite = get_node(&quot;Attack1&quot;)&lt;/p&gt;

&lt;p&gt;onready var timer = $AttackTimer&lt;/p&gt;

&lt;p&gt;func &lt;em&gt;ready():&lt;br&gt;
    timer.start()&lt;br&gt;
    rand.randomize()&lt;br&gt;
    add&lt;/em&gt;to_group(&quot;attack&quot;)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;set_process_input(true)
get_sprite_frames(0).get_frame_count(&quot;Attackanimation&quot;)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;func &lt;em&gt;process(&lt;/em&gt;delta: float) -&amp;gt; void:&lt;br&gt;
    var frames = preload(&quot;res://assets/Attackanimation.tres&quot;)&lt;br&gt;
    get&lt;em&gt;child(0).set&lt;/em&gt;frames(1)&lt;/p&gt;

&lt;p&gt;func &lt;em&gt;on&lt;/em&gt;AttackTimer&lt;em&gt;timeout():&lt;br&gt;
    queue&lt;/em&gt;free() &lt;/p&gt;

&lt;p&gt;for making my attacks appear, but it's not working. Can you please help me?&lt;/p&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/97373/how-fix-code-for-making-the-attacks-appear-random-positions</guid>
<pubDate>Sun, 07 Mar 2021 17:22:21 +0000</pubDate>
</item>
<item>
<title>Answered: how to simplify this code?</title>
<link>https://godotengine.org/qa/96771/how-to-simplify-this-code?show=97360#a97360</link>
<description>&lt;p&gt;I guess the simplest approach is to do a &lt;code&gt;for i in range(1,10)&lt;/code&gt; and use some string formatting for the keys. eg &lt;/p&gt;

&lt;pre&gt;
var slotName = &quot;player_slot%d&quot; % i
var dictName = &quot;player_dict_%d&quot; % i
 if get_node(player_slot_path + checkbox).name == slotName:
        if PlayerGlobalStat[dictName].empty () == true:

....
&lt;/pre&gt;
</description>
<category>Engine</category>
<guid isPermaLink="true">https://godotengine.org/qa/96771/how-to-simplify-this-code?show=97360#a97360</guid>
<pubDate>Sun, 07 Mar 2021 14:28:37 +0000</pubDate>
</item>
</channel>
</rss>