gordonramp Posted January 27, 2010 Share Posted January 27, 2010 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? Quote AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64. Link to comment Share on other sites More sharing options...
Rick Posted January 27, 2010 Share Posted January 27, 2010 If you are having it point to the camera, which you can get anywhere with fw.main.camera I think, then you can put it in the characters class file. Quote Link to comment Share on other sites More sharing options...
gordonramp Posted January 27, 2010 Author Share Posted January 27, 2010 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. Quote AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64. Link to comment Share on other sites More sharing options...
gordonramp Posted January 30, 2010 Author Share Posted January 30, 2010 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 ------------------------------------------- Quote AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64. Link to comment Share on other sites More sharing options...
Recommended Posts
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.