Jump to content

Recommended Posts

Posted

So i was starting a new project and modeled an Player with some bones.

It is in a third person view and the problem is that you cant see where the player looks (to pick up objects).

So I just started to Insert the camrotation on the x axis inro a SetRotation function.

 

1. function Script:UpdateWorld()

2. self.entity:SetRotation(Math:self.camRotation.x,0,0)

3.

4. end

 

I get the error: function arguments exspected near "." , (in the 2. line)

The herarchy looks sth like this :

 

Player(fpsPlayer)

SantaModel

->arms

...

-> Head (right here is the Script attached)

Camera(this has no script but is attached to Player)

 

I dont know wheres the problem , it is probably some newbie mistake.

To make sure, the camRotation.x is in an other script.

Posted

You can get the camera eye vector like this from the entity matrix directly :

cameraeyevector = Vec3(camera.mat.k.x,camera.mat.k.y,camera.mat.k.z):Normalize()

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...