Roland Posted June 9, 2012 Share Posted June 9, 2012 (edited) http://www.youtube.com/watch?v=h_w7fwkUI8Q My character is moved randomly as seen in the video.There is not much special about the codeI load my scene which contains the door, firepit and terrain using LoadScene LoadScene( "abstract::testlevel.sbx" ); I load my character model using LoadModel TModel _model = LoadModel( "abstract::celly.gmf" ) ; I create a contoller [code] // _height is 1.7 // _modelPos is position of the character loaded // CollisionType::Prop is 1 TController _controller = CreateController( _height ); PositionEntity(_controller, modelPos ); SetBodyMass(_controller, 1); SetBodyGravityMode(_controller, 1 ); EntityType(_controller, CollisionType::Prop); In my main loop i call update on controllerNote.. I do not force any movement at all in the UpdateControllerI do not have any code that could move the character or controller at all. // _mode is the character model loaded UpdateController( _controller ); RotateEntity( _model, EntityRotation(_controller ) ); PositionEntity( _model, EntityPosition(_controller) ); Cant find out why the model is moving around by it self.Have done this before in other test snippets without problemsbut now this happens. Any hints?I have done this before without any problems. It was when rewriting my code-lib which I lost (see my blog) this occurred. So I'm doing something weird dumb this time. Just cant find out what. I commented out all code that could move the character in any possible way, bit still she moves. Edited June 9, 2012 by Roland Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Naughty Alien Posted June 9, 2012 Share Posted June 9, 2012 ..can you see controller moving with debug physics enabled ??.. also, have you try to swap positions of UpdateController( _controller ); and RotateEntity( _model, EntityRotation(_controller ) ); PositionEntity( _model, EntityPosition(_controller) ); in your main loop ?Is it controller parented to anything ? Quote Link to comment Share on other sites More sharing options...
Canardia Posted June 9, 2012 Share Posted June 9, 2012 Random movement occurs when 2 physics bodies are parented, and they are colliding with eachother. The solution is the make the 2 bodies of different collisiontype, for example 6 and 7. And course to make sure that type 6 and 7 are not setup with EntityCollisions to collide with eachother. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Roland Posted June 9, 2012 Author Share Posted June 9, 2012 Random movement occurs when 2 physics bodies are parented, and they are colliding with eachother. The solution is the make the 2 bodies of different collisiontype, for example 6 and 7. Yes Meta... That was the problem. Naught.. you were also into the solution (Is it controller parented to anything ? ).. Thanks Quote Roland Strålberg Website: https://rstralberg.com 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.