x


On Network GameObject Movment and Rotation Problem.

So I was trying to move and animate my Object Over Network. I tried using this script

@RPC
function MovementAround(){

            transform.position += transform.forward * WalkSpeed * Time.deltaTime;
            transform.eulerAngles.y = cameraTarget.transform.eulerAngles.y;   



}             

The GameObject is moving correctly over the network But it's not rotating around with the rotation of the mainCamera following it. cameraTarget is a transform of the MainCamera which have the script "MouseOrbit" for the same GameObject.

I have tried to using this script in a Non-network Game and it works perfectly.

Where is the problem then? Do i have to Observe the rotation or something of the Main Camera using NetworkView or what?

more ▼

asked Jun 04 '12 at 09:07 PM

OzzyRawrz gravatar image

OzzyRawrz
57 1 3 4

(comments are locked)
10|3000 characters needed characters left

1 answer: sort newest

Oh Well I have figured out my Answer myself.

I had to add a Network View component in the MainCamera. Well It Works now.

more ▼

answered Jun 04 '12 at 10:35 PM

OzzyRawrz gravatar image

OzzyRawrz
57 1 3 4

(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:

x3003
x2167
x1369
x710
x135

asked: Jun 04 '12 at 09:07 PM

Seen: 436 times

Last Updated: Jun 04 '12 at 10:35 PM