reposition entity on trigger hit

Blitz3D Forums/Blitz3D Programming/reposition entity on trigger hit

Rook Zimbabwe(Posted 2004) [#1]
I suppose this is kind of like a portals problem. But it really isn't.

I have a snall FPS. I have a pair of switch entitys (cubes) that when HIT hide and show various levels of the game. You go from outside to inside here.

Trigger 1 is just inside the old church... when you hit it you hear a door slam sound and the mesh is changed. You don't see the mesh change but it does.

This works FINE.

On the crypt level there is a second trigger that teleports you back outside to the start point (for now) It hides all the crypt stuff and replaces the ground plane.

This ALMOST works fine.

It hides and shows all that it is supposed to show.

BUT it won't reposition the camera entity. The camera stays where it was when it hit the second switch.

I have tried telling it to move the camera before it does anythig else.

I have tried setting up a variable that would move the camera from withon the body of the main program.

I am stumped... Why won't the camera move to the new location?

-RZ


Bot Builder(Posted 2004) [#2]
I'll bet your camera has collisions applied, right?

PositionEntity still lets collisions happen.


Danny(Posted 2004) [#3]
try a "ResetEntity camera" after you've repositioned the camera..


Rook Zimbabwe(Posted 2004) [#4]
resetentity does reset the collisions... but the camera will not reposition... I can't figure out a teleport effect.

OK collisions ar counted for the camera. Do you think I need to count them for a player entity and try to move that and make the camera a child of the player? Would repositioning a player be easier?


Rook Zimbabwe(Posted 2004) [#5]
I did this simple code to illustrate... BUT the simple code works...
I can't explain it... HERE the command POSITIONENTITY works... but HERE...
(this is a biggie)
No joy!!! Why???
-RZ
PS If you want to use ANY part of this code be sure and give Ross, Ross C, Wolron, Neuromancer and Me a nod in the credits! :)


Matty(Posted 2004) [#6]
Simply set the entitytype of your camera to 0 immediately prior to teleporting and after teleporting set it back to whatever it was. In otherwords don't check whether the camera collides immediately prior to teleporting but set the collision type for the camera back to what it should be after placing it where you want it.


Rook Zimbabwe(Posted 2004) [#7]
It was a location problem. The coordinates were not exact... and I do mean exact!!! ALSO I had to move the camera FIRST. My fault.
-RZ