Morrowind like display labels 3D Godot
Average Godot Enjoyer
I like the way Morrowind labels are displayed here is a good way to do it in Godot. I'm making more videos like this related to Morrowind. I want to remake a small scene to copy Morrowind in Godot I'm going to call it "Morrowind at Home" after the meme: "We have x at home". Thanks for watching code below. Your subscription really helps but I don't like shilling.
0:00 demonstration
Player extends KinematicBody
var attackRate : float = 0.3
var lastAttackTime : int = 0
var moveSpeed:float = 10
var jumpForce : float = 10.0
var gravity : float = 15.0
var vel : Vector3 = Vector3.ZERO
onready var FPItemCast : RayCast = $CamHolder/Camera/FPItemCast
func _ready(): add_to_group("Player")
onready var current_collider onready var previuos_collider onready var incoming_collider
func allow_interaction(): if FPItemCast.is_colliding():
incoming_collider = FPItemCast.get_collider()
if incoming_collider != current_collider: previuos_collider = current_collider current_collider = incoming_collider if current_collider.is_in_group("Item"): current_collider.display_label() else: if current_collider: if current_collider.is_in_group("Item"): current_collider.hide_label() current_collider = null
func _physics_process(delta): allow_movement(delta) allow_interaction()
func allow_movement(delta):
#this function allows basic movement and uses the function get_input() to get the direction to move in.
vel.x = 0
vel.z = 0
var input = get_input() #this is where we get our characters forward facing direction var dir = transform.basis.z * input.z + transform.basis.x * input.x vel.x = dir.x * moveSpeed vel.z = dir.z * moveSpeed
#gravity vel.y -= gravity * delta
if Input.is_action_just_pressed("jump") and is_on_floor(): vel.y += jumpForce
vel = move_and_slide(vel, Vector3.UP)
func get_input(): #this will always return zero y var input = Vector3.ZERO
if Input.is_action_pressed("forward"): input.z += 1 if Input.is_action_pressed("back"): input.z -= 1 if Input.is_action_pressed("left"): input.x += 1 if Input.is_action_pressed("right"): input.x -= 1
return input.normalized()
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Bottle
extends Area
onready var eyes = $Eyes onready var sprite = $Sprite3D
func _ready(): add_to_group("Item")
func display_label(): print("displaying") sprite.visible = true
func hide_label(): print("hiding") sprite.visible = false ... https://www.youtube.com/watch?v=qQcRR4Bb2tU
21563219 Bytes