Hi, I want to achieve the same camera and point system as used in Mattline1’s TPS but have run into some difficulties achieving the desired results. Can anyone assist me in this?
Thank you for your help. I have another problem that I hope you can assist me with. I would like to have an empty shoot a ray and when ever it makes contact with a wall, a camera gets placed at that point. And I would prefer not to use any scripts if possible. Thank you
You will have to use scripts, however they are pretty simple,
Ray--------------Python
import bge
from mathutils import Vector
cont=bge.logic.getCurrentController()
own=cont.owner
sens= cont.sensors['Ray']
if 'camera' not in own:
own['camera']=bge.logic.getCurrentScene().objects['Camera']
else:
if sens.positive:
own['camera'].worldPosition=sens.hitPosition
else:
offset= Vector([0,10,0])
offset= own.worldPosition+(own.worldOrientation*offset)
own['camera'].worldPosition=offset
however this is very “snappy”
you probably want
import bge
from mathutils import Vector
cont=bge.logic.getCurrentController()
own=cont.owner
sens= cont.sensors['Ray']
if 'camera' not in own:
own['camera']=bge.logic.getCurrentScene().objects['Camera']
else:
if sens.positive:
vec= Vector(sens.hitPosition)
own['camera'].worldPosition=((own['camera'].worldPosition*15)+vec)*.0625
else:
offset= Vector([0,10,0])
offset= own.worldPosition+(own.worldOrientation*offset)
own['camera'].worldPosition=((own['camera'].worldPosition*15)+offset)*.0625
This will smoothly move from one place to another.
I can make a lil demo if you need it.