Hello all,
I am having trouble positioning and moving an instanced entity. Basically, I am trying to instance a snowball in front of my creature and have him throw that snowball at the target. When I instance the object, I can force the position, but I don't know how to calculate the position relative to the player facing.
I also do not know how to calculate and apply the correct the velocity vector to be applied in order for the snowball to be thrown. As part of this, I would also like to be able to adjust this trajectory during the physics update in case I need to track a target. I do not want to use the Nav Mesh related commands of move or follow as I do not want the snowball to be bound to only navigable terrain.
I have scoured the forums and reviewed the Project Saturn tutorials for a few days now, but I haven't been able to find a solution. I would GREATLY appreciate any help you can provide. I thought the Transform command might be the right idea, but it didn't react the way I expected.
Example Code:
local Snowball = nil --entity
local Snowball_Model = nil-- entity
local Origin = Vec3(0,0,0)
self.Snowball_Model = Prefab:Load("Prefabs/Weapons/Snowball.pfb")
self.Origin = Thrower:GetPosition(true)
self.Snowball = self.Snowball_Model:Instance()
self.Snowball:SetPosition(self.Origin.x + 1, self.Origin.y +1, self.Origin.z + 1)
--self.Snowball:SetPosition(Transform:Point(1,1,1,self.Origin, nil) --Tried this but it placed
--the snowball far away from the model.
self.Snowball:Point(self.Target)
Thanks in advance,
Allaric