# Shape Action and Raycast

**URL:** <https://blenderartists.org/t/shape-action-and-raycast/558805>\
**Category:** Game Engine Support and Discussion\
**Created:** [December 6, 2012, 9:20am UTC](https://blenderartists.org/t/shape-action-and-raycast/558805 "2012-12-06T09:20:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![erlebach](https://blenderartists.org/letter_avatar_proxy/v4/letter/e/ebca7d/32.png) [@erlebach](https://blenderartists.org/u/erlebach)\
**Post date:** [December 6, 2012, 9:20am UTC](https://blenderartists.org/t/shape-action-and-raycast/558805/1 "2012-12-06T09:20:44Z")

</div>

Hi,

I have created a terrain (cut-up a plane + subdivisions + elevation), and I have cubes roving on this terrain. I use Raycasting to make sure the cube remains aligned and on the terrain as it moves.

I have also created a shape action so that the terrain can deform in time. However, the raycasting only computes the intersection of a ray with the _original_ terrain mesh, whereas I would like the intersection to be computed with the changing mesh. I am seeking to create a game where the terrain can deform in time.

Any hints?

Thanks for your help,

```
Gordon
```

---

<div class="post-metadata">

**Author:** ![agoose77](https://blenderartists.org/user_avatar/blenderartists.org/agoose77/32/442949_2.png) [@agoose77](https://blenderartists.org/u/agoose77)\
**Post date:** [December 6, 2012, 10:55am UTC](https://blenderartists.org/t/shape-action-and-raycast/558805/2 "2012-12-06T10:55:16Z")

</div>

This is the wrong place to post. You should ask in the Game-Engine support and discussion thread.  
Regardless, you’re looking to call a function from Python - reinstancePhysicsMesh()  
This is computationally intensive, so beware if using detailed geometry. This thread will be moved by a moderator in due course.

---

<div class="post-metadata">

**Author:** ![Fweeb](https://blenderartists.org/letter_avatar_proxy/v4/letter/f/ee7513/32.png) [@Fweeb](https://blenderartists.org/u/Fweeb)\
**Post date:** [December 6, 2012, 10:57am UTC](https://blenderartists.org/t/shape-action-and-raycast/558805/3 "2012-12-06T10:57:26Z")

</div>

Moved from “Game Engine Resources” to “Game Engine Support and Discussion”
