Jump to content

PointEntity()


gordonramp
 Share

Recommended Posts

Well I found this command and it looks like it will do what I want which is to have an object face the camera when I'm moving around in fp mode. Say, a character watching you. Something like...

 

PointEntity(character, camera, 3, 1, 0)

 

The thing is, I'm not sure how to go about setting this up.

Do I place the code in the Character's class file, or in the fp main loop?

AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64.

Link to comment
Share on other sites

Thanks, I'll give it a try.

Update: It can't be something as simple as placing

 

PointEntity(character,fw.main.camera, 3, 1, 0)

 

in the class file because I get an 'Access Violation' error.

AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64.

Link to comment
Share on other sites

Finally I got this sorted. This class file will point a stationary character at the camera.

-------------------------------------------

require("scripts/class")

local class=CreateClass(...)

 

function class:CreateObject(model)

local object=self.super:CreateObject(model)

 

function object:Update()

self.model:Point(fw.main.camera, 3, 1, 0)

end

end

-------------------------------------------

AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64.

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...