Horlum Posted March 13, 2012 Posted March 13, 2012 I use Leadwerks Engine 2.5 Evaluation, but in it there is one problem. In lua i use function of SetPositionf, but result not display. In what may be the problem? Quote
Horlum Posted March 14, 2012 Author Posted March 14, 2012 I tried to change the position of emitter, in FirePit. But he remains at the center, no change. Quote
Daimour Posted March 14, 2012 Posted March 14, 2012 It works fine for me. Look at the video below. I hope it will help. 2 Quote
Horlum Posted March 14, 2012 Author Posted March 14, 2012 Wow thanks, i not used this is function Update. in this was problem. Quote
Daimour Posted March 14, 2012 Posted March 14, 2012 i not used this is function Update. in this was problem. Update() function is called every frame. So it's not the best place to call SetPositionf() if you just want to place an emitter in certain position. But it's suitable if you want to move the emitter. I used Update() function just because it was the simplest way to see (and show) result immediately. 1 Quote
Horlum Posted March 14, 2012 Author Posted March 14, 2012 In function class:CreateObject(model) not work Quote
Daimour Posted March 14, 2012 Posted March 14, 2012 I think it happens because position of emitter overrides in UpdateMatrix() function. UpdateMatrix() occurs every time when you place or move your firepit in Editor. Use something like Move() function in UpdateMatrix() to shift emitter in desired position. function object:UpdateMatrix() self.heathaze:SetMatrix(self.model.mat) self.fire:SetMatrix(self.model.mat) self.fire:Movef(0,1,0) --move fire up a little self.sparks:SetMatrix(self.model.mat) end Quote
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.