Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Nog on June 02, 2014, 12:36:45 PM
-
Hello Playmaker Forum,
I have just finished the 3rd person camera tutorial from the Hutong Games video tutorials. It is a good 3rd person camera system; however, this camera setup does not prevent the camera from going through walls and other obstacles. How would I go about building a camera collision system into this setup using Playmaker so that the camera does not go through walls and other objects? Any ideas?
Thank you for your help.
Thanks,
Nog
-
make you camera have a parent. This parent would be your actual camera position.
When it collide, your camera can not goes in.
Make a state when your camera position is not matching its parents position, it try to reach that position ;) (using iTween)
I suggest you to prevent that state (reach position) to do anything when your character is not moving anymore (to avoid some shaking problem)
that is how i would handle that ;)
this is simple, you can do more complicated things.
-
Hello vonpopov,
Thank you for the reply. I will give this setup a try. Again, thank you for your help.
Nog
-
Raycasting would be your next bet- but I'm not sure that's as easy to explain. You should cast a ray from your player's head to your camera point- and position the camera at the ray's length, or intersection.
-
Hello TrentSterling,
Thank you for the reply. Are there any tutorials or examples that you could direct me toward? I will give your advice a try.
Thanks,
Nog