Maris Posted February 4, 2015 Share Posted February 4, 2015 (edited) x = SpawnPrefab("cutgrass")x:Remove()print(x) --still cutgrassIs it ok to use x.persists? Edited February 4, 2015 by Maris Link to comment Share on other sites More sharing options...
rezecib Posted February 4, 2015 Share Posted February 4, 2015 (edited) Is it ok to use x.persists? No, x.persists is just a flag that determines whether it saves the prefab when saving the world. For example, placers don't persist, they should never appear when reloading a world. If x:Remove() has been called, x should be nil. But you can (and should) instead hook into the OnRemoveEntity function, which will be way more efficient (and timely) than checking periodically if something has been removed. Edited February 4, 2015 by rezecib Link to comment Share on other sites More sharing options...
Maris Posted February 4, 2015 Author Share Posted February 4, 2015 If x:Remove() has been called, x should be nil.This is not true. X will be nil if and only if I execute following code:x = nil Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now