Hi!
Is it possible to have such a team in the future? And how can I do without her?
I just need to let ray from object A to object B.
obj = 0;
rayID = 0;
function onInit(objID)
obj = objID;
rayID = physics.createRay();
physics.rayDebugLines(rayID,1);
end
function onUpdate( td )
x,y,z = entity.getPosition(obj)
direction = newType.vec3(entity.getDirection(obj, entity.getIDFromTag("target")));
hitID,pox,posy,posz = physics.rayFromPointByAxis(rayID, x,y,z, direction.x,direction.y,direction.z, 10);
-- | Alternate method of getting direction. Not needed for this code though
--targetPos = newType.vec3(entity.getPosition(entity.getIDFromTag("target")));
--direction = newType.vec3(x-targetPos.x ,y-targetPos.y, z-targetPos.z);
end
SolarPortal wrote:
- Code: Select all
obj = 0;
rayID = 0;
function onInit(objID)
obj = objID;
rayID = physics.createRay();
physics.rayDebugLines(rayID,1);
end
function onUpdate( td )
x,y,z = entity.getPosition(obj)
direction = newType.vec3(entity.getDirection(obj, entity.getIDFromTag("target")));
hitID,pox,posy,posz = physics.rayFromPointByAxis(rayID, x,y,z, direction.x,direction.y,direction.z, 10);
-- | Alternate method of getting direction. Not needed for this code though
--targetPos = newType.vec3(entity.getPosition(entity.getIDFromTag("target")));
--direction = newType.vec3(x-targetPos.x ,y-targetPos.y, z-targetPos.z);
end
local direction = newType.vec3(entity.getDirection(obj, target));
local targetQuery = 2
local hit,x,y,z = physics.rayFromPointByAxis(self.ray2, self.x,self.y,self.z, direction.x,direction.y,direction.z, dist/20,targetQuery)
я все сделал, но ничего не изменилось..
I did, but nothing has changed ..
SolarPortal wrote:я все сделал, но ничего не изменилось..I did, but nothing has changed ..
Users browsing this forum: No registered users and 38 guests