cassius Posted June 11, 2011 Posted June 11, 2011 Is there any way of stopping camera going thru walls in a 3rd person game. ? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
macklebee Posted June 11, 2011 Posted June 11, 2011 easiest is to just add a body much like shown in the Spectator tutorial Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel
Rick Posted June 11, 2011 Posted June 11, 2011 One other way which I've done before was to use EntityVisible from the camera location to the camera target (I just used pivots at either location to make it easy, but there are other ways to get the same effect) and if it's not use LinePick from the player to the camera looking for the first hit. Then move your camera to that hit. The benefit of this is that it won't allow anything to come between your camera and your player, if that's what you are looking for. Pillars for example would be where body collisions and this method would differ, but it all depends on what you are looking for. Sometimes it's cool to have the camera go behind pillars. Quote
cassius Posted June 11, 2011 Author Posted June 11, 2011 Yeah going thhrough pillars looks good. We often see this effect in films. But my camera goes through walls in the middle of a sword fight.I made the room bigger to avoid this but thats just a fudge. I prefer a coding solution. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
Naughty Alien Posted June 11, 2011 Posted June 11, 2011 ..by use of LinePick to determine is there any obstacle between cam and cam target, and by use of TFormVector to smoothly and nicely align camera based on results from LinePick, is the most elegant way to go.. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.