Camera Jumps When Mouse Clicked

My goal currently is to have a line go from the center of a ball at the bottom of the screen to where my mouse is clicking. I currently have that part working.

The problem is while holding down on the mouse the camera moves. So my thought was add a Camera Actor that I could position to show exactly what I wanted to see and then not have to worry about the movement.

While the camera no longer moves when the mouse moves, the whole scene “jumps up” when I click the mouse.

While you can’t really “see” how everything jumped up, you can see how the line appears to be starting from the floor instead of the center of the sphere.

I am at a loss as to what is causing this jump.

1 Like

Jumped up as in keeps jumping? To figure out the line issue, we’d need to see the script. But, see below first.

So my thought was add a Camera Actor

Sounds like a good idea at a glance but, hear me out. Your viewport was moving because you had no custom Pawn, and was given a default pawn that can move and look around. You switched the camera but you STILL have the old pawn that can move, look around and bump into things. You just may not be able to see it.

  • there is a chance this default pawn interferes with the new camera actor - if you have a springarm with a collision probe, it can definitely boop it
  • when you calculate things, you might be using the default Pawn which is not where your camera is anymore

Instead of making a Camera Actor, make a camera Pawn and Possess it. The default pawn will receive no input. In an ideal scenario, you’d have a custom Game Mode that spawns a custom pawn with camera and all.

1 Like

I do have a custom Game Mode, it just is using the default Pawn at the moment. I can look into making a custom Pawn to go with it.

1 Like

Do give it a go. It will be automatically possessed. You can use a player start to position it.

1 Like

That solved the problem. The line now behaves as intended and no movement while using the mouse.

Thank you.

1 Like