Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Let me explain first: I wanted to make weapons rotate when camera is rotating, but not instantly. I wanted to make something like in good old Bitsturbed. Just like that: As you can see, it rotates as it should. But, well, here's the problem: the .gif image here just can't describe how clanky this rotation is. I run this project on 60 FPS, and the .gif animation is 20, so, the real result is worse. I want to make this rotation a bit smooth, so that your eyes won't bleed looking at it (still, they will bleed if you'll look at this HUD). Here's the basic script: /* I thought about dividing the "Rot - this.PrevRot" part by two, but this resulted "flickering" of object if I rotated so fast. So, how can I make it smooth? Little edit: I think about one solution now, and I'll try to make it, don't know will it work though. |
||||
|
Okay, I somehow managed to do it... BUT now there's another problem: var Vect = new vector3d (Rot.x - this.PrevRot.x, Rot.y - this.PrevRot.y, 0); What this line does, is that it takes current camera rotation and then substracts its previous rotation. Sounds fine, eh? Now here's the problem: if previous rotation, for example, was 358 and a new one is 364, it will turn 364 into just 4, so, 4 - 358 is a bit wrong answer here. How can I evade that? |
||||
|
@dekon_17 maybe you're looking for something like this: CopperCube FPS Child Node Animator which is another of @smn_mhmdy's great CopperCube contributions, very well working from my experience to be found for a small fee on itch.io (free demo available): https://samgamesio.itch.io/behav... |
||||
|
I MADE IT Can't belive that I've finalized this mess. Basicly, I used this to fix the rotation: if (Rot.x >= 272) And yes, hadoken, I know about that one, I remember there was a post about it. However, I am trying to do mostly my own scripts for my main project, to understand the programming and, well, make my project even more like... my own? So, yeah, this might be a good solution, but I'll try to do my own stuff (even though I usually get into trouble with it, so, I ask help there, on forum). But still, I appreciate your suggestion. |
|