Yue Posted February 18, 2021 Share Posted February 18, 2021 I am trying to restart the player after his death to a specific point on the map, as you can't create an animation to make him stand up, but this doesn't work for me, after deleting the character and creating a new one about three times this gets very slow. function this:Update() if Window:GetCurrent():KeyHit(Key.R) then if self.r == false then self.player2 = self.player:Instance(),"Yue" self.player:StopAnimation() self:SetPositionMeshs() self:SetRotationMeshs() self:SetParent(true) self:CreateJoints() self:SetMass(1.0) self.r = true end end if self.r == true then --self:UpdateBones() if Window:GetCurrent():KeyHit(Key.T) then self:SetParent(false) self.player:Release() self.player = self.player2 --self.player2:Release() --self.r=false end end end I think the truth is that I'm a very bad programmer and I'm going to give up on this, I always run into certain difficult obstacles and the same process and get nowhere. Quote Link to comment Share on other sites More sharing options...
Ttiki Posted February 21, 2021 Share Posted February 21, 2021 Don't give up ?. Programming is about running into difficulties and problem sometimes. You need to planned out what you need and how you can do it before hand to avoid problems, but you will eventually run into something that will give you a hard time if you are working on a big script. To answer your problem, on this forum post ( ) reepblue gave a code snippet of a character controller with a respawn function. Here is the direct link to the comment with the code in it. Hope it will help you with your problem?. 1 Quote Just making games for fun. Currently working on T3-L4 Link to comment Share on other sites More sharing options...
Josh Posted February 23, 2021 Share Posted February 23, 2021 Why not just call SetPosition()? Quote My job is to make tools you love, with the features you want, and performance you can't live without. 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.