x


setting a character controller orientation by script

Hi I hope I am not asking a dumb question...

I am creating an application in wich I use 3 cameras : a fly camera (the user is free to fly in the scene), and 2 character controller based cameras. I switch from the fly cam to one of the character controller camera using a trigger (collider set as trigger) At the beginning of the scene, the character controller is inactive and got an initial orientation (let's call it Orient0).

When I switch to this camera the orientation is the initial orientation. I walk around, put the character controller in a specific orientation (let's call it Orient1) and switch back to the fly cam (pressing escape key) I fly around and re enter the trigger.

The character controller is, at this time, in the Orient1 orientation. Why ?

I have tried everything (store the initial orientation, restore it the FPSWalker.js script with a frame delay, without a frame delay, restore the orientation before the camera activation, after the camera activation, with 2 frames delay, outside of the FPSWalker.js script) the character controller camera is always in the orientation (Orient1) the character was before switching back to the flycam.

Anyone got an hint ? an explanation ?

Thank you

more ▼

asked Aug 17 '10 at 01:48 PM

Nawash 1 gravatar image

Nawash 1
1 1 1 1

I don't understand your question. You leave the char in Orient1, switch to the fly cam, move that cam around (and therefore NOT the char controller?), and switch back to the char cam - which obviously hasn't moved and ist still at Orient1.

Aug 17 '10 at 04:08 PM Wolfram

when I switch back to char cam, I set the orientation (to "Orient_that_I_want") of the character controller (tried before and after activating it) but the orientation is not modified. The orientation is still Orient1. I am still puzzled.. does this make any sense to you ? Is there an orientation cache system upon activation in the "not all source code accessible" character controller ?

Aug 19 '10 at 04:46 PM Nawash 1

It is almost impossible to answer your questino without seeing some of your code; especially how you switch back to the char controller and set the orientation. Also, how exactly do you "switch" between cameras? With c.enabled? or c.depth? some other way? How exactly do you navigate your char / char controller)? If your fly cam doesn't have a char controller, how do you navigate that? Or is it fixed? Or does it follow the char?

Aug 26 '10 at 10:30 AM Wolfram
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

related - does anyone have a controller for flying? or moving in 3D versus on terrain?

more ▼

answered Aug 19 '10 at 10:56 PM

mike f gravatar image

mike f
1

This is not an answer; please do not ask new questions inside other questions (even when related). Just ask a new question - it is much more likelty to be noticed.

Aug 26 '10 at 10:32 AM Wolfram
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3014
x1047
x525
x237
x124

asked: Aug 17 '10 at 01:48 PM

Seen: 2218 times

Last Updated: Aug 17 '10 at 01:48 PM