![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | bgegg |
I used to receive a code for the circular movement.
I do not completely understand, but I am in the process of learning.
Can I point the camera towards the character?
I think the camera’s local y-axis should be pointing towards the character.
extends Sprite
#直径
var R=100
var xangle
var yangle
var direction
var time = 0
var character_position
func _ready():
pass
func _process(delta):
character_position = get_parent().get_node("character").get_transform().origin
time = time + delta * 100
xangle=sin(deg2rad (time))
yangle=cos(deg2rad (time))
direction = Vector2(xangle, yangle)
direction=direction.normalized()*R
position = direction + character_position
and this is video by code.
please help.
https://i.imgur.com/c4dS9sa.mp4
You mean pointing the arrow at the character?
Dlean Jeans | 2019-07-01 06:02
Thank you very much.
I’m sorry. my english poor.
That means such a movement.
red triangle is camera
bgegg | 2019-07-01 10:22
https://i.imgur.com/ZFBbSU5.mp4
i use look_at function.
It is not a beautiful circle
Can you make it a beautiful circle?
bgegg | 2019-07-01 11:11