Skip to content

actor调用K2_DestroyActor后,立刻调用IsValid会返回true。 #292

Closed
@unicodecndddd

Description

在lua中actor调用K2_DestroyActor后,立刻调用IsValid会返回true。
但这时候因为actor已经被设置ispendingkill。它身上的所有函数都不能调用。
如下

local actor -- 一个角色蓝图
actor:K2_DestroyActor() --销毁
print(actor:IsValid() == true) --true
print(UE4.UKismetSystemLibrary.IsValid(actor) == true) --true
print(actor:K2_GetRootComponent()) -- 返回nil。由于UObject::ProcessEvent检测IsPendingKill,不执行

实际上现在缺少了一个判断actor是否正在被销毁的函数

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions