#So my camera system is buggy

6 messages · Page 1 of 1 (latest)

fickle anchor
#

I've added a camera system similar to mario odyssey where the camera doesnt follow the player on the Y axis unless the player is on the floor or the player falls below the floor they were previously stepping on. Now some times the camera will clip into floor, I know this happens because the "pivot" node gets too far into the floor and brings the camera with it. How could I prevent this? (Screenshots of the code and my players node tree will be in the forum)

lavish pilot
#

does the flickering stop if you set the third argument on move_toward to be 1 instead of 0.2?

lavish pilot
#

I think the problem is with using local positions instead of global positions when you do your comparisons. even global positions will give you problems unless you have camera, last_floor_touched and target_y to be set to top-level in Node3D > Transform. without that, all these move with the player

try giving each of them thin CSGboxes as children to see where they are each frame?

merry shale
#

My suggestion is to separate camera and use node3d as child of spring arm instead.

Now you need to do custom camera logic with character body with sphere collision shape with camera3d as its child, then you move and slide the character body to position of the node3d and interpolate the basis to node3d basis.
That should allow camera to act as physic object avoiding clipping with collider while still trying to get into correct position / rotation