- Home /
Duplicate Question
Object moving faster when camera moves with it than without camera movement
Hi All, Scenario: 1. Need to move camera along x & y axis with the movement of an object.(kind of camera following an object) 2. the delta movement in every step must be same for camera and object both so that they always in sync. e.g. if object moved 0.5 in x axis (no movement in y) than camera has to move 0.5 along x axis (no movement should be in y axis).
following is the way i wrote the code: 1. calculate the object delta movement along x and y axis. 2. add the same amount in camera's x and y coordinates. 3. attach this script with Object
Now, there is a BIG PROBLEM :( When Object moves alone (without camera movement), the speed is normal. every thing looks good. But, when camera starts moving with object, though both are in sync but Object seems to RUN VERY FAST.
Is there any problem with LOGIC or its just a perspective view that's playing tricks with me????
Many thanks for your help!!
Cant you see in the scene view, if the object is still moving at the same speed? Also we can fix your code (if it's wrong) but only if you post it
there are so many problems here. I suggest unityGE$$anonymous$$S.com for beginner articles on unity. also you simply parent the camera to the character in that situation ("drag the camera under the character in your hierarchy")
I urge you to search on here for 100s of questions on camera, FPS, movement, physics, follow, orbit, etc etc. Note that Unity completely INCLUDES, FOR FREE, many many many camera scripts that will do all for you.
@Fattie Well, it seams as though all of the high karma mods are now taking a HUGE crackdown on all questions, not thinking twice about closing and everything XD
I like the "new" unity answers