Skip to content
Discussion options

You must be logged in to vote

here's my solution for a custom TimeLimit decorator:
*edited order, Flee can interrupt, Approach Player which can interrupt Follow Path.

I hope I didn't override something with on exit, otherwise it works as expected.

@tool
extends BTTimeLimit

@export var time_out_set :bool
@export var agent_bool : String
@export var state : bool

func _generate_name() -> String:
	return "TimeOut"

func _exit():
	if elapsed_time >= time_limit and time_out_set:
		if agent_bool in agent:
			var val = agent[agent_bool]
			assert(val is bool)
			agent[agent_bool] = state

Replies: 10 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by OtherRealms
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants