How can I ensure each vehicle is positioned the same way?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I have a car spawning system and a viewport so the player can see the car they’d like to spawn. I want all the cars to appear in the center of the viewport, however that’s not happening.

  1. What is the issue? Include screenshots / videos if possible!

The issue is that while each vehicle is positioned at 0,0,0 and the camera is fixed in a good location, each vehicle seems to move a bit. I believe this could be due to the bounding box of the model, or more likely the drive seat of the vehicle. I’m not sure this is right though, since the drive seat is centered in each vehicle.

I ran an experiment and positioned all the cars at the same spot and this is what happens.

This is the issue I’m experiencing in the viewport:

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I’ve tried all sorts of searches pertaining to offsets as I figured maybe I could set up a camera and a vehicle and calculate that offset to use, however, it didn’t lead me anywhere helpful; besides I’m pretty bad at understanding CFrames.

If anyone has any ideas or pointers, please let me know as I’ve been chipping away at this for two days yet I can’t find an answer that’ll provide the result I’m looking for.

1 Like

Still haven’t found a fix for the problem, if anyone else has worked on any sort of vehicle menu how have you all done it?

You can add a single part for the camera to track if you want to ignore any external parts that may interfere with the camera.

I think that’s essentially what im doing with the drive seats since they’re all positioned the same. This might be an issue based on the vehicle size/shape itself

1 Like

I got a bit closer to my goal by using code I found on the forum here:

however I’m still noticing the differences. Maybe If I zoomed the camera out a bit it’d help but I think this is the closest I’ll get for now

1 Like

For a car specifically you might want to use the bottom of the front bumper as the point of reference to position it in the frame, so its not cut off. You could calculate how far back the camera needs to be to have the closest front bumper corner be inside the frame fully, by reversing the calculation to get its screen point.