Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lua中的self.bCanEverTick似乎不起作用?(真正用法是怎样的?) #584

Open
yfcyt opened this issue Mar 5, 2024 · 2 comments
Labels
question Further information is requested

Comments

@yfcyt
Copy link

yfcyt commented Mar 5, 2024

local LuaGameMode = {}

function LuaGameMode:ReceiveBeginPlay()
self.Super:ReceiveBeginPlay()
self.bCanEverTick = false
end

function LuaGameMode:ReceiveTick(DeltaSeconds)
print("LuaGameMode:ReceiveTick",DeltaSeconds)
end

return Class(nil, nil, LuaGameMode)

这里无论是将bCanEverTick设置为true或者false,都会执行ReceiveTick方法

@liubai01
Copy link
Contributor

liubai01 commented Mar 9, 2024

在 4.26里面 有两个坑点:

  1. bCanEverTick改变了:
function DamageZoneActor:ReceiveBeginPlay()
    print("DamageZoneActor:ReceiveBeginPlay")
    
    self:SetActorTickEnabled(true)
    print(self:IsActorTickEnabled())

    self.Super:ReceiveBeginPlay()
end
  1. 需要在对应Actor蓝图里面保证Event Tick Enabled。注册任意函数再删掉,Compile蓝图即可。
    image

@yfcyt
Copy link
Author

yfcyt commented Mar 18, 2024

在 4.26里面 有两个坑点:

  1. bCanEverTick改变了:
function DamageZoneActor:ReceiveBeginPlay()
    print("DamageZoneActor:ReceiveBeginPlay")
    
    self:SetActorTickEnabled(true)
    print(self:IsActorTickEnabled())

    self.Super:ReceiveBeginPlay()
end
  1. 需要在对应Actor蓝图里面保证Event Tick Enabled。注册任意函数再删掉,Compile蓝图即可。
    image

确实是这样的,3q!
我用的ue 5.3.2版本,也是如此~

@zjhongxian zjhongxian added the question Further information is requested label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants