Alienhead Posted November 6, 2024 Share Posted November 6, 2024 This bug has been going on since week1 of testing.. Code: model:SetPosition(player.rhand:GetPosition()) model:SetRotation(player.rhand:GetRotation()) model:Attach(player.mesh, player.rhand) Attaching a gun to the players hand bone * ( common practice ) * results in some very funky behavior. Quote Alienhead Components and Software Link to comment Share on other sites More sharing options...
Solution Josh Posted February 25 Solution Share Posted February 25 This issue appears to be solved. When the space key is pressed the camera, light, and model will move at a speed of 60 meters per second. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->Move(0, 2, -8); //Create light auto light = CreateBoxLight(world); light->SetRotation(45, 35, 0); light->SetRange(-10, 10); //Model by PixelMannen //https://opengameart.org/content/fox-and-shiba auto model = LoadModel(world, "https://github.com/UltraEngine/Documentation/raw/master/Assets/Models/Characters/Fox.glb"); model->SetScale(0.05); model->Animate(1); model->SetRotation(0, -90, 0); auto neck = model->skeleton->FindBone("b_Neck_04"); Vec3 rotation; auto box = CreateBox(world); box->Move(0, 1, 0); box->Attach(model, neck); //Main loop while (window->Closed() == false) { if (window->KeyDown(KEY_SPACE)) { model->Translate(1, 0, 0); camera->Translate(1, 0, 0); light->Translate(1, 0, 0); } world->Update(); world->Render(framebuffer); } return 0; } 1 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.