Download

Change mouse panning speed based on proximity to predetermined boundaries

Hi there.

I’m at work now but I’m hoping someone can help me think.

I’ve basically got a camera that gets rotated around an object up to a certain point (Let’s say between -30 and 30 degrees Yaw and 10 and 50 degrees Pitch). I’m doing this using mouse x and y to drive the different rotation values and then clamping angles so when I rotate left/right or up/down the perceived animation I get is a hard stop (Which is correctly what clamp is doing). I don’t like this hard limit though, it’s terrible.

If I could have the blueprint aware of the change in rotation going towards a bound then I could change the “pan speed” variable I have in that direction down to 0 as it approaches the bound using some maths (I’ll figure the maths out later). What would be even nicer visually is if I could have it come to a stop slightly beyond the bound and when you let go it softly bounces back to the bound. I’m sure I can figure that out once I figure the first bit out.

My GUESS is that if I can separate the mouse motion into positive and negative (if Mouse.X change in value is negative do branch A else do branch B roughly) then I can tell it to slow down the pan speed variable to 0. Obviously I’d have to make it so that you can still pull away from the bound! HAHA!

These are my thoughts. If anyone wants to see my blueprints I’ll gladly post them but I doubt it’s necessary for this thought experiment.

Thanks!