Jump to content

Recommended Posts

Posted

Hi! When I used Entity:Move child entities of model wont work. 3D model is moving but Leadwerks stuff like pivots, cameras etc. won't move. I discovered it on that script:

Script.object = "" --entity "Starship"
Script.pivot = "" --entity "CameraPos"
Script.uppoint = "" --entity "FowardPivot"
Script.backpoint = "" --entity "BackPivot"
Script.camera = "" --entity "Camera"
function Script:Start()

end

function Script:UpdateWorld()
objectrot = Vec3()
if window:KeyDown(Key.W) then

self.object:Move(self.uppoint:GetPosition())
end


if window:KeyDown(Key.A) then
local oldrotation = Vec3()
local newrotation = Vec3()
oldrotation = self.object:GetRotation()
newrotation = oldrotation+Vec3(0,0,0.7)
self.object:SetRotation(newrotation)
objectrot = newrotation

end

if window:KeyDown(Key.D) then
local oldrotation = Vec3()
local newrotation = Vec3()
oldrotation = self.object:GetRotation()
newrotation = oldrotation+Vec3(0,0,-0.7)
self.object:SetRotation(newrotation)
objectrot = newrotation

end
end

The

Script.uppoint = "" --entity "FowardPivot"

is a child of

Script.object = "" --entity "Starship"

. When i try to move with "W" pivot should go with spaceship but it won't.

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...