39 lines
1.1 KiB
GDScript
39 lines
1.1 KiB
GDScript
@tool
|
|
class_name NPC extends CharacterBody3D
|
|
|
|
@export var _movement:NPCMovement
|
|
|
|
@export var facingDirection:EntityMovement.FacingDirection:
|
|
set(value):
|
|
if _movement:
|
|
_movement.facingDir = value
|
|
get:
|
|
if _movement:
|
|
return _movement.facingDir
|
|
return EntityMovement.FacingDirection.SOUTH
|
|
|
|
@export var walkSpeed:float = 48.0:
|
|
set(value):
|
|
if _movement:
|
|
_movement.walkSpeed = value
|
|
get:
|
|
if _movement:
|
|
return _movement.walkSpeed
|
|
return 48.0
|
|
|
|
@export var runSpeed:float = 64.0:
|
|
set(value):
|
|
if _movement:
|
|
_movement.runSpeed = value
|
|
get:
|
|
if _movement:
|
|
return _movement.runSpeed
|
|
return 64.0
|
|
|
|
func onInteract(player:Player) -> void:
|
|
UI.TEXTBOX.setText("Hello, I'm an NPC!\nThis is the second line here, I am purposefully adding a tonne of words so that it is forced to go across multiple lines and you can see how the word wrapping works, not only using Godot's built in word wrapping but with my advanced visibile characters smart wrapping. Now I am doing a multiline thing\nLine 1\nLine 2\nLine 3\nLine 4\nLine 5\nLine 6\nLine 7\nLine 8\nLine 9\nLine 10");
|
|
pass
|
|
|
|
func _enter_tree() -> void:
|
|
pass
|