That worked! Also adding a collision with the display also helps with correcting collisions so they match with the rotation of the location go. It’s a bit laggy than I would like, but I think I can optimize it from here
For any one else who has this issue in the future, my code looks like this for the arrow:
function init(self)
self.arrowpos0=go.get_position()
self.idc=0
self.id=0
self.start_tracking=false
end
function update(self, dt)
if self.start_tracking==true then
go.set_position(go.get_position(self.idc))
self.arrowpos1=go.get_position()
self.direction=self.arrowpos0-self.arrowpos1
self.angle=math.atan2(self.direction.y,self.direction.x)
self.rotation=vmath.quat(vmath.quat_rotation_z(self.angle))
go.set_rotation(self.rotation, self.id)
self.arrowpos0=go.get_position()
end
end
function on_message(self, message_id, message, sender)
self.idc=message["ida"]
self.id=message["idb"]
self.start_tracking=true
end
For the player (the person spawning the arrow)
self.arrow_spawn = collectionfactory.create("Charac#Arrow", go.get_position())
msg.post(self.arrow_spawn[hash("/Arrow")], "apply_force", {force = vmath.vector3(self.charge_bow*300*self.last_horiz, self.charge_bow+action.y*5, 0), position = go.get_world_position()})
msg.post(self.arrow_spawn[hash("/arrow")], "id", {ida=self.arrow_spawn[hash("/Arrow")],idb=self.arrow_spawn[hash("/arrow")]})
and the outline for the arrow’s spawn collection