this post was submitted on 01 Sep 2023
3 points (100.0% liked)

Godot

5840 readers
6 users here now

Welcome to the programming.dev Godot community!

This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.

Make sure to follow the Godot CoC while chatting

We have a matrix room that can be used for chatting with other members of the community here

Links

Other Communities

Rules

We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent

Wormhole

!roguelikedev@programming.dev

Credits

founded 1 year ago
MODERATORS
 

I'm trying to use a tween to change the position of one of the points in a line2d, but I'm not sure what the syntax would be for this.

This is what I have: tween.tween_property(line, "points", target_position, time)

Obviously this doesn't work because points has more than one point to make the line. If I need index 1 of points specifically, how would I do that? Or do I have to address it as a whole PackedVector2Array?

EDIT: I found the answer to this in case anyone else stumbles across this. You use colons, like this:

tween.tween_property(line, "points:1, target_position, time)

all 3 comments
sorted by: hot top controversial new old
[โ€“] TechieDamien@lemmy.ml 2 points 1 year ago

Another way would be to add your own property with custom getter/setter and tween that. Your solution works, but more advanced things might be easier with this method.

[โ€“] HonoraryMancunian@lemmy.world 1 points 1 year ago (1 children)

As someone who just casually saw this post on Everything (and has no idea what godot even is), I must say the title threw me