Get middle of the screen within third person view

Sensang

TH.net Regular
Reaction score
7
So.
I need a way to get the point at what the middle of the screen is pointing to. (like clicking there with an ability selected) This should work for different camera angles because im planing on using that for first or third person view. The mouse will be locked to the center so getting the point where the mouse is pointing at.

So the point on the terrain not on the screen... hope someone can help me.

btw. pointing to a tutorial or some map where this already works would be fine. But all of the tutorials/maps I've seen included a system in which projectiles are launched from the unit's position by a trigger.

It should work like in that map: http://www.youtube.com/watch?v=IO5wNBiVrnU

But I have no idea how it is done...
 

wingdnosring

New Member
Reaction score
16
Very cool. The way I have it (for the moment) on my Third Person Shooter System is this:

Create projectile
Change projectile height to (((speed of weapon)*sin(Pitch of Camera))/sin(90-Pitch of Camera))

Then you need a periodic event trigger to actually move the bullet forward.

However, I see three things wrong with this system that I created:
1) I'm still working out how to compensate for cliffs
2) In the video that guy appears to be using beams, which are easier (I think) but require the data editor
3) The data editor is probably way more efficient for this than my old trigger-happy ways...

[Edit]: Naturally that is for changing a unit's height. It just hit me that you wanted to detect the center of the screen, not shoot a bullet. To detect the center of the screen, use these functions:

"Camera Yaw of Player (?)" gives you the X,Y rotation.
"Camera Pitch of Player (?)" gives you the Z rotation.
 

Sensang

TH.net Regular
Reaction score
7
Very cool. The way I have it (for the moment) on my Third Person Shooter System is this:

Create projectile
Change projectile height to (((speed of weapon)*sin(Pitch of Camera))/sin(90-Pitch of Camera))

Then you need a periodic event trigger to actually move the bullet forward.

However, I see three things wrong with this system that I created:
1) I'm still working out how to compensate for cliffs
2) In the video that guy appears to be using beams, which are easier (I think) but require the data editor
3) The data editor is probably way more efficient for this than my old trigger-happy ways...

[Edit]: Naturally that is for changing a unit's height. It just hit me that you wanted to detect the center of the screen, not shoot a bullet. To detect the center of the screen, use these functions:

"Camera Yaw of Player (?)" gives you the X,Y rotation.
"Camera Pitch of Player (?)" gives you the Z rotation.

I need a way to get the point at what the middle of the screen is pointing to.

this should be for aiming with spells and bullets... Im wanna work with the data editor as much as i can. So im actually ordering my unit to use its ability on that point. So yes It should be the point my camera is pointing TO.

But nevertheless... you helped me there :D

I will try some vector solution, so getting the middle of the screen is a start... maybe there is something to check for terrain and what not ... :)
 

Sensang

TH.net Regular
Reaction score
7
I believe the Screen Look-At is this. Though, I could be wrong.

could you plz be a little more specific? I have no idea at which point I can use that... If it's in the data or trigger editor. Is it a point ? Well i will look for it nontheless, thank you :)
 

Sensang

TH.net Regular
Reaction score
7
could someone plz tell me where "screen - look at" is??? and ofc what kind of data it is...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top