# Is there any good example of a camera collision?

**URL:** <https://blenderartists.org/t/is-there-any-good-example-of-a-camera-collision/1376942>\
**Category:** Game Engine Support and Discussion\
**Tags:** bge\
**Created:** [April 29, 2022, 11:21pm UTC](https://blenderartists.org/t/is-there-any-good-example-of-a-camera-collision/1376942 "2022-04-29T23:21:34Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saranoske](https://blenderartists.org/letter_avatar_proxy/v4/letter/s/cab0a1/32.png) [@Saranoske](https://blenderartists.org/u/Saranoske)\
**Post date:** [April 29, 2022, 11:21pm UTC](https://blenderartists.org/t/is-there-any-good-example-of-a-camera-collision/1376942/1 "2022-04-29T23:21:34Z")

</div>

I’m using rays to measure the distance from the camera to either move closer to the player because of a wall or move away from the player when there is no obstacle.  
But sometimes when the ray does not collide with the obstacle correctly, it makes the camera jitter.  
Is there any good example of a camera collision?

---

<div class="post-metadata">

**Author:** ![Cotaks](https://blenderartists.org/user_avatar/blenderartists.org/cotaks/32/21677_2.png) [@Cotaks](https://blenderartists.org/u/Cotaks)\
**Post date:** [April 30, 2022, 1:53am UTC](https://blenderartists.org/t/is-there-any-good-example-of-a-camera-collision/1376942/2 "2022-04-30T01:53:22Z")

</div>

Try mine:

> [@Third person 8 directional movement system (also for upbge 0.3.0)](https://blenderartists.org/t/third-person-8-directional-movement-system-also-for-upbge-0-3-0/677410):
>
> Hello, You get the third person movement system (8 directional) including my keybindings script. Added: a converted version for UPbge (28-2-2019) Controls: K - open the keybindings menu WSAD - move SPACE - jump mouse - lookaround scrollwheel - zoom left shift - run BGE: [Tera movement system.blend](https://blenderartists.org/uploads/default/original/4X/f/1/f/f1ff0989aa481423933d68591fafcdd29aa3201b.blend) (762 KB) UPBGE: [8 directional movement system(upbge).blend](https://blenderartists.org/uploads/default/original/4X/7/1/9/719e71cccdfcbe0eba941d0963f56f4f56156d99.blend) (785.4 KB) - For upbge 3.0 download upbge version and change player\_camera.py line 27 to 31 into: …

---

<div class="post-metadata">

**Author:** ![Saranoske](https://blenderartists.org/letter_avatar_proxy/v4/letter/s/cab0a1/32.png) [@Saranoske](https://blenderartists.org/u/Saranoske)\
**Post date:** [April 30, 2022, 11:27pm UTC](https://blenderartists.org/t/is-there-any-good-example-of-a-camera-collision/1376942/3 "2022-04-30T23:27:00Z")

</div>

Thank you for helping me.  
I’ll check it out as soon as I can.

---

<div class="post-metadata">

**Author:** ![RPaladin](https://blenderartists.org/user_avatar/blenderartists.org/rpaladin/32/981579_2.png) [@RPaladin](https://blenderartists.org/u/RPaladin)\
**Post date:** [May 10, 2022, 12:50am UTC](https://blenderartists.org/t/is-there-any-good-example-of-a-camera-collision/1376942/4 "2022-05-10T00:50:18Z")

</div>

Here’s a decent tutorial on camera collision:

[![](https://blenderartists.org/uploads/default/original/4X/4/3/d/43dc2953dcbbbb74b2b7b7f15bd696c73cb94776.jpeg "Camera Collision in BGE") ](https://www.youtube.com/watch?v=Jim9W8B1KhU)

---

<div class="post-metadata">

**Author:** ![Saranoske](https://blenderartists.org/letter_avatar_proxy/v4/letter/s/cab0a1/32.png) [@Saranoske](https://blenderartists.org/u/Saranoske)\
**Post date:** [May 10, 2022, 2:33am UTC](https://blenderartists.org/t/is-there-any-good-example-of-a-camera-collision/1376942/5 "2022-05-10T02:33:56Z")

</div>

Hi, I’ve tried your blend file the Tera movement system and I can’t move.  
No key reacts, not even the mouse.  
I’ve tried it in 2.79.

---

<div class="post-metadata">

**Author:** ![Cotaks](https://blenderartists.org/user_avatar/blenderartists.org/cotaks/32/21677_2.png) [@Cotaks](https://blenderartists.org/u/Cotaks)\
**Post date:** [May 10, 2022, 3:00am UTC](https://blenderartists.org/t/is-there-any-good-example-of-a-camera-collision/1376942/6 "2022-05-10T03:00:54Z")

</div>

hmm strange, did you download the bge version?  
What does the console say?

Also you want to move out of bge 2.79 and go to upbge 0.2.5 to avoid tons of bugs in bge 2.79 itself. Still the file should work

#edit downloaded 2.79 to test and is working perfectly fine.

---

<div class="post-metadata">

**Author:** ![Saranoske](https://blenderartists.org/letter_avatar_proxy/v4/letter/s/cab0a1/32.png) [@Saranoske](https://blenderartists.org/u/Saranoske)\
**Post date:** [May 10, 2022, 8:37pm UTC](https://blenderartists.org/t/is-there-any-good-example-of-a-camera-collision/1376942/7 "2022-05-10T20:37:10Z")

</div>

It’s weird, the console just says:

```auto
Warning: could not open 'D:\PROJEKTY\Blender Tutorials\Tera movement system.bgeconf'
***NO GD/SAVE file found!***
No GD found -> setting default keys
Warning: could not open 'D:\PROJEKTY\Blender Tutorials\Tera movement system.bgeconf'
Warning: could not open 'D:\PROJEKTY\Blender Tutorials\Tera movement system.bgeconf'

```

---

<div class="post-metadata">

**Author:** ![Cotaks](https://blenderartists.org/user_avatar/blenderartists.org/cotaks/32/21677_2.png) [@Cotaks](https://blenderartists.org/u/Cotaks)\
**Post date:** [May 11, 2022, 1:05am UTC](https://blenderartists.org/t/is-there-any-good-example-of-a-camera-collision/1376942/8 "2022-05-11T01:05:22Z")

</div>

that error is due to no save file for the keybinds, that is not what stopping it because it puts out the error then it will set default keys (aswd).

When running try pressing K it open the keybinds menu, then hit save to get rid of that error.

---

<div class="post-metadata">

**Author:** ![Saranoske](https://blenderartists.org/letter_avatar_proxy/v4/letter/s/cab0a1/32.png) [@Saranoske](https://blenderartists.org/u/Saranoske)\
**Post date:** [May 11, 2022, 9:43am UTC](https://blenderartists.org/t/is-there-any-good-example-of-a-camera-collision/1376942/9 "2022-05-11T09:43:26Z")

</div>

When I press K, it shows the same message:

```auto
Warning: could not open 'D:\PROJEKTY\Blender Tutorials\Tera movement system.bgeconf'

```

I guess for some reason it doesn’t create a new file for `Tera movement system.bgeconf`

---

<div class="post-metadata">

**Author:** ![Cotaks](https://blenderartists.org/user_avatar/blenderartists.org/cotaks/32/21677_2.png) [@Cotaks](https://blenderartists.org/u/Cotaks)\
**Post date:** [May 11, 2022, 1:21pm UTC](https://blenderartists.org/t/is-there-any-good-example-of-a-camera-collision/1376942/10 "2022-05-11T13:21:45Z")

</div>

very strange, try running blender as adminstrator and see if that works.

r click on blender icon → run as admin.

---

<div class="post-metadata">

**Author:** ![Saranoske](https://blenderartists.org/letter_avatar_proxy/v4/letter/s/cab0a1/32.png) [@Saranoske](https://blenderartists.org/u/Saranoske)\
**Post date:** [May 11, 2022, 2:39pm UTC](https://blenderartists.org/t/is-there-any-good-example-of-a-camera-collision/1376942/11 "2022-05-11T14:39:03Z")

</div>

That helped and the message doesn’t show anymore.  
But it kept doing nothing until I’ve unchecked the script `settings.on_startup`  
After that I could finaly move.
