tumira Posted December 3, 2015 Share Posted December 3, 2015 Hi Bought the engine and been doing some tutorials. Awesome stuff. While doing some tutorial I noticed some strange stuff. Script.respawnPoint ="" --entity "Respawn Point" function Script:Collision(entity, position, normal, speed) if entity:GetKeyValue("name") == "FPSPlayer" then spawnPos = self.respawnPoint:GetPosition() entity:SetPosition(spawnPos) end end The above code does not work on prefab ? If I change some property values, then the warning comes up telling me that this is not going to be an instanced prefab. If I clicked "OK" the above code will works otherwise it wont work. (I tested multiple times to confirm this) I following tutorials from this guy. He is using version 3.1 and the same codes work on prefab (based from the video) Also I think I notice someone else having the same problem here, I think.. http://www.leadwerks.com/werkspace/topic/11631-incomplete-objects-with-collision-type-trigger-always-box/#entry84154 I'm using the beta branch(4.0). Thanks Quote Link to comment Share on other sites More sharing options...
shadmar Posted December 3, 2015 Share Posted December 3, 2015 What is the output if you add to the top of the function: System:Print(entity:GetClassName().." - "..entity:GetKeyValue("name")) Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
tumira Posted December 3, 2015 Author Share Posted December 3, 2015 It shows this for prefab Model - For the non prefab it shows this (I just change the property values and click "OK" to confirmed as non prefab instance.) Model - FPSPlayer This should be a bug correct ? Quote Link to comment Share on other sites More sharing options...
tumira Posted December 3, 2015 Author Share Posted December 3, 2015 Anyway I just created and uploaded a simple map based from the FPS Template. Here are the links https://dl.dropboxusercontent.com/u/65841566/GetKeyValuePrefab.zip The original FPS template player prefab name is "fpsplayer" and not "FPSPlayer". So I changed the codes to reflect this. Still same error occurs. Just jump over the platform to trigger it. Quote Link to comment Share on other sites More sharing options...
shadmar Posted December 3, 2015 Share Posted December 3, 2015 Yes this doesn't work, so probably a bug yes. If you want a quick workaround you can add this to fpsplayer.lua Script.name="fpsplayer" And change your code in DeathTrigger to: if entity.script.name~=nil and entity.script.name == "fpsplayer" then 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
tumira Posted December 4, 2015 Author Share Posted December 4, 2015 @shadmar thank you ! Hopefully Josh can fix this for the official release 4.0 Quote Link to comment Share on other sites More sharing options...
beo6 Posted December 4, 2015 Share Posted December 4, 2015 maybe still the same issue i wrote about here, when the prefab is placed in the editor? http://www.leadwerks.com/werkspace/topic/13055-prefabs-not-working-correctly/ I know i wrote there about 2 issues, but at first i thought they might be connected. turned out the first one was just a misunderstanding on my side. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.