Cmdpro Posted March 13, 2022 Share Posted March 13, 2022 I am trying to rotate a prefab through code without custom animations, how do I do this? Link to comment https://forums.kleientertainment.com/forums/topic/138231-how-do-i-rotate-a-prefab/ Share on other sites More sharing options...
Monti18 Posted March 15, 2022 Share Posted March 15, 2022 You can use inst.Transform:SetRotation(rot) --a number in degrees I think Link to comment https://forums.kleientertainment.com/forums/topic/138231-how-do-i-rotate-a-prefab/#findComment-1548470 Share on other sites More sharing options...
Cmdpro Posted March 19, 2022 Author Share Posted March 19, 2022 (edited) On 3/15/2022 at 6:03 AM, Monti18 said: You can use inst.Transform:SetRotation(rot) --a number in degrees I think inst.Transform:SetRotation(90) doesnt seem to do anything, what am id oing wrong? i ensured its being called EDIT : inst.Transform:SetRotation(0.5) doesnt seem to do anything either Edited March 19, 2022 by Cmdpro Link to comment https://forums.kleientertainment.com/forums/topic/138231-how-do-i-rotate-a-prefab/#findComment-1550232 Share on other sites More sharing options...
Monti18 Posted March 22, 2022 Share Posted March 22, 2022 Did you use it on the server or the client? You may need to use it in the client to see a difference. Try it in the console by entering ThePlayer.Transform:SetRotation(90) Link to comment https://forums.kleientertainment.com/forums/topic/138231-how-do-i-rotate-a-prefab/#findComment-1551104 Share on other sites More sharing options...
Cmdpro Posted March 29, 2022 Author Share Posted March 29, 2022 On 3/22/2022 at 11:47 AM, Monti18 said: Did you use it on the server or the client? You may need to use it in the client to see a difference. Try it in the console by entering ThePlayer.Transform:SetRotation(90) On client it worked however it is changign the character direction animation instead of rotating the prefab Link to comment https://forums.kleientertainment.com/forums/topic/138231-how-do-i-rotate-a-prefab/#findComment-1553742 Share on other sites More sharing options...
Monti18 Posted March 30, 2022 Share Posted March 30, 2022 Then I'm unsure what you mean with rotating the prefab, as for me changing the character direction animation is rotating the character. Link to comment https://forums.kleientertainment.com/forums/topic/138231-how-do-i-rotate-a-prefab/#findComment-1553808 Share on other sites More sharing options...
Cmdpro Posted March 30, 2022 Author Share Posted March 30, 2022 (edited) 4 hours ago, Monti18 said: Then I'm unsure what you mean with rotating the prefab, as for me changing the character direction animation is rotating the character. what i mean is like rotting the anim so 180 and the anim is flipped and 90 would be the anim on its side Edited March 30, 2022 by Cmdpro fixing a typo Link to comment https://forums.kleientertainment.com/forums/topic/138231-how-do-i-rotate-a-prefab/#findComment-1553837 Share on other sites More sharing options...
Monti18 Posted April 1, 2022 Share Posted April 1, 2022 Ah so you mean rotate around the z-axis right? Unfortunaly I don't know how to do that... Link to comment https://forums.kleientertainment.com/forums/topic/138231-how-do-i-rotate-a-prefab/#findComment-1554383 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