# How could we move or reset the vehicle in forward direction only?

**URL:** <https://forum.playcanvas.com/t/how-could-we-move-or-reset-the-vehicle-in-forward-direction-only/29103>\
**Category:** Help & Support\
**Tags:** scripting, physics\
**Created:** [January 3, 2023, 6:34am UTC](https://forum.playcanvas.com/t/how-could-we-move-or-reset-the-vehicle-in-forward-direction-only/29103 "2023-01-03T06:34:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yash\_mehrotra](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yash_mehrotra/32/21484_2.png) [@yash\_mehrotra](https://forum.playcanvas.com/u/yash_mehrotra)\
**Post date:** [January 3, 2023, 6:34am UTC](https://forum.playcanvas.com/t/how-could-we-move-or-reset-the-vehicle-in-forward-direction-only/29103/1 "2023-01-03T06:34:54Z")

</div>

I want to reset the vehicle in the forward direction whenever it falls off the track or gets turned in opposite direction. Please help me figure out the same. I have coded the following in trigger script whenever the vehicle is out of track but it not always gets reset properly facing in the forward direction.

```
    other.setLocalEulerAngles(0, 0, 0, 0);
    other.rigidbody.teleport(-3.5, 1, other.getLocalPosition().z, 0, 0, 0);

```

Below is the link to the test scene.  
[https://playcanvas.com/editor/scene/1626114](https://playcanvas.com/editor/scene/1626114)

---

<div class="post-metadata">

**Author:** ![Leonidas](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/leonidas/32/6495_2.png) [@Leonidas](https://forum.playcanvas.com/u/Leonidas)\
**Post date:** [January 7, 2023, 8:22pm UTC](https://forum.playcanvas.com/t/how-could-we-move-or-reset-the-vehicle-in-forward-direction-only/29103/2 "2023-01-07T20:22:00Z")

</div>

Hi @yash_mehrotra,

Did you figure this out? The project seems to be down/private and not accessible right now.

---

<div class="post-metadata">

**Author:** ![yash\_mehrotra](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yash_mehrotra/32/21484_2.png) [@yash\_mehrotra](https://forum.playcanvas.com/u/yash_mehrotra)\
**Post date:** [January 9, 2023, 7:45pm UTC](https://forum.playcanvas.com/t/how-could-we-move-or-reset-the-vehicle-in-forward-direction-only/29103/3 "2023-01-09T19:45:17Z")

</div>

@Leonidas Yeah I have figured this out. You could close it.
