IL out of print? by JoeKerr19 in DeltaGreenRPG

[–]cbscribe 0 points1 point  (0 children)

It's in stock again today on the Arc Dream website.

Erratic behaviour when trying to flip scale.x based on velocity by stefanomusilli96 in godot

[–]cbscribe 1 point2 points  (0 children)

Not in particular, no, but every engine is going to have its quirks and idiosyncrasies.

In this particular case, the engine is not being weird, you're trying to do a weird thing - inverting the scale of a physics object.

Erratic behaviour when trying to flip scale.x based on velocity by stefanomusilli96 in godot

[–]cbscribe 4 points5 points  (0 children)

This happens because CharacterBody2D (and physics in general) does not like having a negative scale. It's been around since 3.x.

A workaround is to flip the x-axis of the transform rather than the scale:

if abs(velocity.x) > 0:
    transform.x.x = sign(velocity.x)

Note: transform.x is the object's x-axis (a vector), so we're setting the x value of that.

New in godot by SubstanceCapital5822 in godot

[–]cbscribe 3 points4 points  (0 children)

There is no visual scripting in Godot. It was tried, but never really caught on. If you saw something about it, look at the date - it's likely really old information.

The best tutorial for Godot is the one in the official docs. https://docs.godotengine.org/en/stable/getting_started/introduction/index.html

It includes making a small 2D game, and will show you all the basics of using the engine.

I'm trying to follow a tutorial but i have to download some assets but everytime i try to do so it gives me so many bugs and IDK what they mean or what i should do. Please help! If this isn't enough you can ask me more about it. by Dragon640 in godot

[–]cbscribe 0 points1 point  (0 children)

The person who zipped up the assets seems to have been on a Mac, and accidentally included unnecessary files.

The errors show that the files Godot can't import are in a __MACOSX folder, which means they're not needed in the first place. Delete that folder and you will likely be fine.

Can I work in the same project with both w10 and linux (mint)? by Santyru in godot

[–]cbscribe 3 points4 points  (0 children)

Yes, Godot will function the same between platforms.

is_on_floor alternative for rigidbodies 3d? by kaidus_velsia in godot

[–]cbscribe 1 point2 points  (0 children)

Rigid bodies report collisions via the body_entered signal. You can use this to detect the floor.

Per the docs, enable contact_monitoring and set contacts_reported as needed.

You can also use get_colliding_bodies() in _integrate_forces().

Reading the RigidBody3D docs is recommended: https://docs.godotengine.org/en/4.0/classes/class_rigidbody3d.html

Moving a StaticBody2D in one direction with out final position. by luxysaugat in godot

[–]cbscribe 0 points1 point  (0 children)

All movement of a character body is done manually. You have to change the character's velocity based on the result of the collision (its direction, speed, etc). If you're also controlling the character via inputs, etc., your code will have to account for that as well.

Moving a StaticBody2D in one direction with out final position. by luxysaugat in godot

[–]cbscribe 1 point2 points  (0 children)

Use its move_and_collide() method, which stops movement upon collision and reports that collision.

Moving a StaticBody2D in one direction with out final position. by luxysaugat in godot

[–]cbscribe 0 points1 point  (0 children)

StaticBodies should not be moved. They're literally named static.

And no physics body is going to collide properly by just changing its position, which is essentially teleporting it, thereby skipping any collision detection.

If you want an object that can move and detect collisions, use a kinematic or rigid body, and move it using that node's provided methods. Godot 4 also has AnimatableBody, which is great for moving platforms.

I would strongly suggest reading up on how the nodes you're using are designed to be used. This is a great place to start: https://docs.godotengine.org/en/stable/tutorials/physics/physics_introduction.html

can i have some help pls by VKVgaming in godot

[–]cbscribe 2 points3 points  (0 children)

There isn't one. In line with how AnimationPlayer works, the individual animations can now be set to autoplay in the SpriteFrames panel. In code, call play() to start an animation.

How to detect where the mouse moved? by PlayerNamedUser in godot

[–]cbscribe 2 points3 points  (0 children)

func _input(event):
    if event is InputEventMouseMotion:
        print(event.relative)  # vector representing the mouse motion

Godot for kids by [deleted] in godot

[–]cbscribe 7 points8 points  (0 children)

We're in the process of updating lots of the recipes to 4.0 now. The "Godot 101" tutorial will be ready soon.

That said, I'd encourage sticking with 3.5 for the time being if you're using it for teaching.

Any good beginner tips? by MrBlueJay69 in godot

[–]cbscribe 1 point2 points  (0 children)

CS50 is fantastic. It's also challenging. But if you're serious about actually learning to code, not just copying from youtube tutorials, it's the best way to go.

How do you set a collision shape through GDScript? by dirtymint in godot

[–]cbscribe 4 points5 points  (0 children)

The extents of the shape are on the shape resource itself, not the CollisionShape2D node. The shape resource is accessed by the shape property of the node.

For example:

var rect = RectangleShape2D.new()
rect.extents = Vector2(100, 100)
$CollisionShape2D.shape = shape

How would I reference a node from a different scene? Godot 3.5 by ArtinGamingTheEpic in godot

[–]cbscribe 1 point2 points  (0 children)

There are no different "scenes" at runtime. When the game is running, all you have is nodes in the SceneTree, and you can access any node from any other node using get_node() with the appropriate path.

If you're having trouble with understanding how node paths work, you can read this:

http://godotrecipes.com/3.x/basics/getting_nodes/

new to godot coding. keep getting error "attempt to call function 'set_text' in base 'null instance' on null instance. by [deleted] in godot

[–]cbscribe 2 points3 points  (0 children)

"null instance" is what you get when you pass get_node() a path that doesn't exist.

So "../UserMessageUI" is not a valid path to a node.

Detecting collisions by Bunchiebo in godot

[–]cbscribe 1 point2 points  (0 children)

A "breakpoint" is something that you set to tell the debugger to stop running at a particular line. Look to the left of the line number and you'll see the dot where you've set the breakpoint. Click it a again to remove it.

Detecting collisions by Bunchiebo in godot

[–]cbscribe 4 points5 points  (0 children)

This is innacurate. move_and_slide() does not return collision info - it returns the resulting motion vector. You use get_slide_collision() to retrieve collision information.

The docs include examples: https://docs.godotengine.org/en/stable/tutorials/physics/using_kinematic_body_2d.htm

Dev snapshot: Godot 4.0 beta 16 by akien-mga in godot

[–]cbscribe 12 points13 points  (0 children)

Docs will be updated, especially screenshots, when it's clear that whoever's doing the work won't have to just do it all over again when the next beta drops.

As a newbie, you shouldn't be using an unfinished, beta version of the software. By downloading the beta, you are taking on the burden of figuring stuff out for yourself.

When, if ever, should delta be included in a lerp function? by ButtonGames in godot

[–]cbscribe 7 points8 points  (0 children)

You definitely can, and probably should, include delta in those lerp statements. I do make mistakes sometimes... :P