# Help with spawning vehicle at correct coordinates

**URL:** <https://forum.scenic-lang.org/t/help-with-spawning-vehicle-at-correct-coordinates/45>\
**Category:** Simulators\
**Created:** [November 15, 2024, 7:30am UTC](https://forum.scenic-lang.org/t/help-with-spawning-vehicle-at-correct-coordinates/45 "2024-11-15T07:30:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![teoks0199](https://forum.scenic-lang.org/letter_avatar_proxy/v4/letter/t/d26b3c/32.png) [@teoks0199](https://forum.scenic-lang.org/u/teoks0199)\
**Post date:** [November 15, 2024, 7:30am UTC](https://forum.scenic-lang.org/t/help-with-spawning-vehicle-at-correct-coordinates/45/1 "2024-11-15T07:30:09Z")

</div>

Hello, we are working on the Scenic interface to BeamNG.

![image](https://forum.scenic-lang.org/uploads/default/original/1X/8e6c6b64c1204309a2672b3ee8b686702f780587.png)  
This is the test scenario where we want to spawn a vehicle at (-717,111,118).

 ![image](https://forum.scenic-lang.org/uploads/default/original/1X/4ed7c0b5f62a0fa55c486c5a636b94a05ce29da1.png)  
 ![image](https://forum.scenic-lang.org/uploads/default/original/1X/5202d3df1a7770e8bec84ee1301ac1079011b21a.png)  
This is the createObjectInSimulator function and ScenicVectorToCoordinates function that we use to get the Scenic Object’s position.  
 ![image](https://forum.scenic-lang.org/uploads/default/original/1X/66e4f02c612ee0f9658281674a97056ff30b52f9.png)  
However, it doesn’t spawn the vehicle correctly at z = 118, but instead spawns at z = 0. Does anyone have any idea why this is the case? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![nathannelson](https://forum.scenic-lang.org/letter_avatar_proxy/v4/letter/n/8dc957/32.png) [@nathannelson](https://forum.scenic-lang.org/u/nathannelson)\
**Post date:** [November 26, 2026, 7:03pm UTC](https://forum.scenic-lang.org/t/help-with-spawning-vehicle-at-correct-coordinates/45/2 "2026-11-26T19:03:20Z")

</div>

A likely culprit is the spawn helper snapping the vehicle to the ground: BeamNG spawn calls often place objects on terrain unless you explicitly disable ground placement or pass the z in the exact position table the API expects. I’d check whether createObjectInSimulator uses the z component at all, and whether ScenicVectorToCoordinates returns (x,y,z) in the same order/type as that spawn function—if it passes only x/y or a Vec3 that gets truncated, z would fall back to 0.
