Stop slow parent when aiming down sights?

Any idea how?
I made an “aiming down iron sights” animation, but combining that with slow parent is terrible.

Bonus Question:
-Sorta the same thing, but with jumping. The player is simply an invisible cube with cylindrical arms, and when jumping, you catch a glimpse of the players arms floating.

Any idea how to prevent these two problems from occurring?

To be honest I have no idea what you mean.

Maybe create a bool so that when you are aiming down sights it’s true and ADS = true will stop slow parent and ADS = false will slow parent again. Of course, you don’t have to name the bool ADS you can name it aimdownsights or whatever you want. I hope you know python. :wink:

@Monster: You know what slow parent is, right? The game is a FPS, and so using slow parent on the gun makes it so the gun isn’t stiff when walking and turning. I want Slow Parent to be disabled when pressing RMB (to aim) to it IS stiff.
…the title IS a bit misleading. I’ll upload a file so you can see for yourself.

@Ezio: I have not heard of a ‘bool’ before, and I hardly know any python. But I see what you’re getting at in regards to the Ture/False…

Lol a bool is a boolean. I code with c++ a lot so I call it a bool. It just handles true\false. It can’t be too hard. I don’t know any python with BGE (or at all for that matter) but maybe Google can help.

Hold RMB and walk around
Note: The camera look script is missing, no big deal though

@Ezio: Ah, of course! I should have known…

I’ll just assume that was for Monster. Lol. But yeah I see what you mean. It is a pain in the butt. I’m doing a little research on the subject for you now. :RocknRoll:

Thats very kind of you,
I almost certain there is no alternate method other than Python…

In which case, I could lower the walking speed when strafing + aiming down the sight, that could lower the impact.
This whole ordeal is making me want to learn Python, considering the game I want to make, it’d be the ideal thing to do.

Yes, I do suggest you learn it. It’s better learned sooner than later. I’m not finding much, but it’s sure to be possible.

EDIT: I just thought of something! Maybe you can use location constraints. Instead of having to turn off slow parent. Just a thought.

EDIT2: Just figured it out. Set it so when RMB is held down (logic bricks) add a constrain actuator with Loc X constrained to -8.7 min and max! Seems as good as it’ll get. :wink:

You need python. obj.timeOffset allows you to set the amount of slow parenting applied to the child object.

Well there ya go. Throws my suggestion out the window! Lol :RocknRoll:

Thank you both, I’ll take a crack at it.
Which code goes on which object?

I would think they both go on the child, as that is where you set the slow parent. Of course, you will need to modify for the gun instead of a camera. I wouldn’t know, I decided to leave BGE. I’m switching to C++ coding.


Now I understand.

I remember there was a similar thread some months ago.

I would do it that way:

Use python to decrease KX_GameObject.timeOffset until 0 and back. Yes, it is an attribute of the child.

But … slow parent influences rotation and motion. Is it still good enough for you?

@Monster I assume you meant to quote RandomPickle97?

oh, yes … damn, i pressed the wrong button :spin:. silly me.

let me correct that … .done

Lol. Amusing.

One final question:
-The two scripts in the link Flame sent, am I supposed to use both? I would guess yes, but then again, I am fail at python. I do see only one of the two have values, so I guess both. What’s the brick setup for this?

If so, are they separate scripts?

I was able to implement the Script SolarLune made yesterday to set a “Text” object’s resolution, but I’m stumped here…

I’d assume both in the same script. But if you want a separate script for getting the offset, go right ahead.:smiley:

check this out

A-D (rotate when not zooming) (rotate 1/2 speed while zoomed)

Right click=(aim/zoom) if gun is at rest position and (Un-Aim)

100% logic, no slow parent( same looking result)


LogicZoomAndGunLag.blend (478 KB)