Plorol Posted February 17, 2021 Share Posted February 17, 2021 (edited) Hi everyone I try to make a character move in forward direction of his model 3D i make a rotation with i take x and y from ControlsApp.MouseDX and ControlsApp.MouseDY node.WorldRotate(x,y,0); How to move forward after this this rotation? I know atan2 will be necessary but i don't know how to implement it Thank you for your help and unigine engine Edited February 19, 2021 by Plorol Link to comment
rohit.gonsalves Posted February 18, 2021 Share Posted February 18, 2021 There is simple trick for this. What I would do. 1. Place your object as a child to parent NodeDummy. 2. Move Forward on NodeDummy. and keep rotating your child object. I hope this will solve your issue. Regards, Rohit Link to comment
Plorol Posted February 18, 2021 Author Share Posted February 18, 2021 (edited) thank you very much for your answer Rohit, it works so far like that, i mean if my mesh rotate by 90° on Z, if i add to its position vec3(0,10) to move forward, it'll move like before any rotation i give a link to a tutorial about rotate and direction (excuse me, it's not adversiting) i don't know how to implement this in unigine Edited February 18, 2021 by Plorol Link to comment
Plorol Posted February 19, 2021 Author Share Posted February 19, 2021 vec3 dir = node.GetWorldDirection(MathLib.AXIS.Y); dir.Normalize(); node.SetWorldDirection(dir,vec3.UP,MathLib.AXIS.Y); node.WorldTranslate(dir * 20.0f * Game.IFps); I found it in bullet.node and firecontroller from thirdperson demo Link to comment
Plorol Posted February 25, 2021 Author Share Posted February 25, 2021 I found https://developer.unigine.com/forum/topic/6402-solved-player-orientation/ Link to comment
Recommended Posts