Esp32 cam and esp32 problem

Basically I am trying to build a project .like when mpu6050 detect accident the esp32 cam click a image and the esp32 xam is attached with the esp32 .my main microcontroller here is eps32 pls help anyone . If possible give the code

We don't 'give' code. What you should do first is read the pinned posts on how to get the best from the forum. I would start with getting the sample code working with your esp32cam. Then get the mpu6050 sample working the way you want. Now merge the two sketches (there is a tutorial on the forum on how to do that)