Skip to content

u/kiwi404

In this archive from Jun 2017 to Apr 2026

105
posts
47
comments
105
media
34k
score
3 saved before deletion

Top posts

Top comments

I was trying to setup a camera system that indecated stage bounds with its movement.

The whole camera rig is bound to the center of the stage, when the player walks of in de distance the camera trails behide with its rotation giving this transitioning feeling to the shoot.

This effect was used alot in JRPG's transitioning from 2D to 3D.

This is the code :

@export var stage_dimentions:Vector2

func _process(delta):

`position = lerp(position,player.position,delta*10.0)`

`position.x = clampf(position.x,-stage_dimentions.x/2,stage_dimentions.x/2)`

`position.z = clampf(position.z,-stage_dimentions.y/2,stage_dimentions.y/2)`


`camera_3d.look_at(((player.position+position)/2)+Vector3.UP,Vector3.UP)`

Camera rig was setup like this :

Node3D ( position 0,0,0) ( Script goes on here )

-> Camera3D ( position 0,4,6) < You can set the position to whatever you like for different angles

239 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.