I want to move unit behind the current camera view, as if we are watching through his eyes, and constantly reposition him along with camera movement. Any ideas how I could do that?
I don't want to lock camera to unit, I want to lock unit to camera. Is this possible?
Well, I want to control the camera without the need to synchronize it with the unit movement. Because I want my camera to focus on other units, while using a special unit behind the camera as a source of abilities.
So basically an.. ego shooter type?
Well, you should be able to get the current camera target. Just periodically:
Move unit to (camera target) offset by xx towards (Rotation of camera - 180).
If you don't actually need it to be there at all times (but only when casting a spell or something) then I'd suggest only doing that.
Well, the camera target is usually in front of the actual camera. The rotation (GUI name, it's Camera Yaw actually, I think) is the angle betweenthe camera and the camera target (in degrees). By substracting 180 and then polar project is I get a point behind the camera, exactly the opposite direction of the Rotation/Yaw.
s3rius, I can't find this rotation of camera. I can store camera rotation in variable, yes, but the trigger that moves unit to point with offset requires a point, and it does not allow to use camera rotation as one. I'm confused. Or you can do this only through custom scripts? EDIT: Oh, figured it out. In case someone is interested - I used (Point With Polar Offset) as a second point for (Point Offset Towards Point) trigger, and used (Camera Yaw-180) as angle. Just like s3rius said.
I want to move unit behind the current camera view, as if we are watching through his eyes, and constantly reposition him along with camera movement. Any ideas how I could do that? I don't want to lock camera to unit, I want to lock unit to camera. Is this possible?
What's the difference?
Well, I want to control the camera without the need to synchronize it with the unit movement. Because I want my camera to focus on other units, while using a special unit behind the camera as a source of abilities.
Yeah that does it. Thanks! Also, what did you meant by (Rotation of camera - 180)?
s3rius, I can't find this rotation of camera. I can store camera rotation in variable, yes, but the trigger that moves unit to point with offset requires a point, and it does not allow to use camera rotation as one. I'm confused. Or you can do this only through custom scripts?
EDIT: Oh, figured it out. In case someone is interested - I used (Point With Polar Offset) as a second point for (Point Offset Towards Point) trigger, and used (Camera Yaw-180) as angle. Just like s3rius said.