Search the Community
Showing results for tags 'turret'.
Hi. I would like to make the rotation of the gun at -45 and +45 (or less) degrees relative to that of the camera. When I limit the values, it only works according to the world coordinate. For example, when I turn a full turn to the left, I have to turn a full turn right again so that the gun rotates in the right direction. I want to do a gun control like Insurgency game. How can I fix this? Here is my code. float currentTime = Time::GetCurrent(); Vec2 currentMousePos = Window::GetCurrent()->GetMousePosition(); Window::GetCurrent()->SetMousePosition(Math::Round(Context::GetCurrent()
http://pastebin.com/yQ2jHPii > I put my script on pastebin for better overview. This is the script I attached to a turret . Basic explaination: It ckecks for enemies nearby and alligns itself to them, calls shoot() function once in a while. The Bullet itself is only for the visual. To hurt the enemy, I will later acces the enemy script trough the turret and call a hurt function. In the start funcion I set up an emitter which should look like a bullet flying . I want to know how i properly let the emitter play , and have multiple bullets at one time. ( or just how to play it , i can ma
I am currently getting problems with the Fpsgun script. I made a prefab and attached it to an turret in the map via path. http://pastebin.com/LapGp5nw Heres the modified fpsgun script. In detail the problem is that the muzzle (shooting direction) should always be in front direction of the turret. The second problem is that the script doesnt know the fpsplayer anymore, so there is no camera to align the effects to. There are going to be multiple turrets in the game, so there should be a global camera, but I dont know how to set it up . I have tried to fix it but it doesnt work really wel
Above some screenshots that are important to understand the problem. function Script:UpdatePhysics() self.entity:Point(self.target, 1, Time:GetSpeed() * self.rotSpeed) end This is a part of my code. The first screenshot is what happens when i run the game. The crawler runs around a path, the turret points at him but is rotated in negative y. What can I do to prevent this ?