Add Object Camera Switch

Hey! I’ve been looking for an example of this and haven’t found one yet.

-I have an FPS game, and when the character that you’re playing as dies, there is a camera change to a 3rd person view of the character dying (such as in Halo). This is what I’ve done:

I have a camera that follows the object that you control (camera actuator), and then I add the character (add object actuator) and switch to that 3rd person camera when you die. The problem is that I can’t get the 3rd person camera to switch to the character as it’s target. Thus, if my character falls off a cliff, the camera doesn’t follow him. If it’s done on the same layer, the camera will switch to other objects, but objects that have been added from a different layer don’t work.

-I have a set-up that works, but it’s pretty crummy.

-Here’s a screenshot:

http://www.box.net/public/8mc96h0glt

Thanks for any help ~ Stu_Flowers

Post the .blend please. The picture you have there doesn’t help much.

PS: For future reference, you can use tags to post images directly to the thread page.

Hmmm…image isn’t working.

Anyway, the original blend would be too confusing, so here’s an example file:

http://www.box.net/public/bv2fxflfu5

P.S. - Social, I really appreciate all the work you put into in these forums. I’ve learned a wealth of information from your work!

Here, I hacked up something for you:

It should work fine now.

Hey thanks alot. It’s people like you that I do it for.

Good luck with your project.

Wow!
This is really good! I’ll place the script into my game and it should run like clockwork.

Thanks for your work! ~ Stu_Flowers

hey social, i noticed that everything is in one layer, i am making a map editor and wen i add a object its camera doesnt work, i parented the camera to the object but wen i add the object the camera gets added with it but its no longer parented to it. how do i make the camer still parented? heres the blend: GPX1.0.blend (364 KB)

Wow… bump?

wut killer?

You made a 2 year bump on this thread =X

oh wow…

lmao… you probably feel really stupid now =P

You don’t… That was the whole point of making the example deal with objects that are all on layer one. Nothing is really getting “added”, instead things are just being teleported in with “setPosition()”, and there’s only one camera switching from object to object.

That was a long time ago, so maybe someone made another workaround, but this method seemed logical at the time.

:rolleyes:

This from a guy who triple-posts.

Yea, I guess so =P I don’t think I’ve bumped anything over 1 year =X