General > Developers Corner

eye look pos

<< < (2/3) > >>

Bite That Apple:
Nope, I don't understand it at all. I can't even get my head around it at all. To my knowledge, I'm about to declare this literally impossible because garry couldn't just make it simple like "player is looking at this pos in his .HitPos so that means I want some magic function to make the player look at that .HitPos."

Nope, he makes all this useless stuff that no one really knows how to use.

MrPresident:
Just because you don't understand how some of the more involved functions in lua work, don't start thinking that something is impossible.
Turns out it's very easy to do.

Try this:
When you set a spawn save two angles.
GetAngles()
EyeAngles()

and then when they respawn or whatever just reset their positions:
SetAngles()
SetEyeAngles()

Turns out all you need is EyeAngles and SetEyeAngles. I just tested it in game.

Take a look:
Lua Example

JamminR:
Wow Bite that Apple, if I've never pictured something someone being said in text before as being dramatic, I think now is definitely a first.


Get some rest. Sleep on it. If you just woke up and are reasonably rested, go focus on something else a while. Outdoors perhaps. :)
As MrPresident just demonstrated, the functions aren't that difficult. I understand that vectors can be challenging when trying to determine specific place in a map, but many functions already exist to grab them. If one doesn't already exist, go to the spot in the map and print player:GetPos() then add it to code.

Bite That Apple:

--- Quote from: JamminR on February 08, 2015, 08:24:37 AM ---Wow Bite that Apple, if I've never pictured something someone being said in text before as being dramatic, I think now is definitely a first.
Get some rest. Sleep on it. If you just woke up and are reasonably rested, go focus on something else a while. Outdoors perhaps. :)

--- End quote ---

Meh... honestly I was getting sick and tired of it. I had run into this problem before, and no one in the entire world of facepunch could help me and solve the issue, so it just annoyed me so {INSERT WORD HERE} much that I could never really get an answer. I had also been working on this project for three days, trying to get that part to work, so I had become really irritable.


--- Quote from: MrPresident on February 08, 2015, 03:50:59 AM ---Just because you don't understand how some of the more involved functions in lua work, don't start thinking that something is impossible.
Turns out it's very easy to do.

Turns out all you need is EyeAngles and SetEyeAngles. I just tested it in game.

--- End quote ---

As I typically same from time to time, "you can do anything and everything in garry's mod, with a little imagination", though this seemed impossible. I have not tested what you have provided me, I'm going to assume it works because you went out of your way to make a little video and inserted your community logo, some fancy text, and even went through the troublesome of actually doing it all.



Will edit this post if works:

MrPresident:
lol, I didn't go through the trouble of doing those things. :P

The community logo thing is automatically added to all of my videos on that youtube channel. One of the perks of having a partner account.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version