yeah it was upside down
Ok, so it appears nothing is stomping the spriteās rotation from outside, and the sprite isnāt axis locked or something.
The next question is, can we make look_at()
do something? If you call look_at(Vector2(0, 3000))
that should point the x+ axis of the sprite downwards. so it should look like a clockwise turn of roughly 90 degrees.
if this changes anything i made it look at the mouse and it followed it fine
Ok, so look_at()
works. That implies that the argument skull.global_position
is somehow not making it do what you expect.
Thatās why I was wondering about the value of it earlier; it seems like everything else is working, so the next question is why skull.global_position
isnāt producing the expected results.
i have no idea
Well, if you do this:
print(skull.global_position)
print(global_position)
Can you copy the output here?
(2465, -937)
(1378, 421)
i worked around it and got it to work
looks like this now and works
extends Sprite2D
@onready var arm: Node2D = $"../../../../collectible_1"
@onready var eyeball: Node2D = $"../../../../collectible_2"
@onready var skull: Node2D = $"../../../../collectible_3"
@onready var player_compass: Node2D = $"../player"
var target = null
@warning_ignore("unused_parameter")
func _process(delta):
if Input.is_action_pressed("ping"):
rotation = player_compass.rotation
You must be using a fairly large screen.
Thatās a delta of (1087, -1358), which is ~51 degrees down? It does look like those should work.
I know itās a bit weird, but what if you do:
rotation = global_position.angle_to_point(skull.global_position)
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.