hislittlecuzin Posted January 4, 2016 Share Posted January 4, 2016 I was watching this tutorial about a trigger that teleports players to a respawn point to mock a falling to one's death and respawning. I noticed 2 differences which may or may not be problems. First in the code: My code: Script.respawnPoint = "" --entity "Respawn Point" function Script:Collision(entity, position, normal, speed) if(entity:GetKeyValue ("name") == ("Player")) then spawnPos = self.respawnPoint:GetPosition() entity.SetPosition(spawnPos) end end his code: Script.respawnPoint = "" --entity "Respawn Point" function Script:Collision(entity, position, normal, speed) if(entity:GetKeyValue ("name") == ("Player") then spawnPos = self.respawnPoint:GetPosition() entity.SetPosition(spawnPos) end end As you can see in line 3, he lacks a second paranthasis after ("player") A second difference is in my steam edition (which was claimed to be compatable) I am lacking some physics functions. I have: Physics mode; collision type; Mass; Character angle; Swept collision; Nav Obstacle; He has: //all of that; and shape functions such as: shape; shape offset; shape rotation; shape size; What is wrong with my code? Everything else is exactly the same. Does his shape thing mean anything? Quote Steam client Leadworks Game Indie engine with Standard Leadworks Game engine plugin. Link to comment Share on other sites More sharing options...
Slastraf Posted January 4, 2016 Share Posted January 4, 2016 Script.respawnPoint = "" --entity "Respawn Point" function Script:Collision(entity, position, normal, speed) if(entity:GetKeyValue ("name") == ("Player")) then local spawnPos = self.respawnPoint:GetPosition() self.entity:SetPosition(spawnPos) end end Quote Link to comment Share on other sites More sharing options...
macklebee Posted January 4, 2016 Share Posted January 4, 2016 A second difference is in my steam edition (which was claimed to be compatable) I am lacking some physics functions While Jorn's videos are great, you must keep in mind that they are not official tutorials provided by Leadwerks. The date of that video was from last Summer, since then Josh has made several tweaks to the editor including removing the Physics Shape from an object's Physics Properties tab. This now has been replaced by using a visual Physics Shape that is built into the Model Editor as shown in the official Leadwerks tutorial about Models and Animation under the Collision section. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel 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.