Scripts / Any way to get Rotation Value of an entity?

Author
Message
GoDevils
9
Years of Service
User Offline
Joined: 24th Sep 2014
Location: Arizona USA
Posted: 6th Apr 2015 23:18
I'm wondering if there is a way to Get from the engine the Y Rotation Value (between 0 - 360 degrees) of an entity??

I do not see this value in the g_Entity [e] [ ?? ]. Is it available from somewhere else of can it be calculated??

Thanks
"THERE IS NO SPOON"

AMD 6300 6 core 3.5 ghz, Windows 8.1, 8GB ram, GTX 650 2GB ram
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 7th Apr 2015 17:13
You need to get the angle, so I ignored if there is some command for that.
I think this is a good place to:



So, you can get the entity angle in any moment. just my thoughs.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Apr 2015 19:42 Edited at: 8th Apr 2015 19:45
im sure there is some complicated 3D maths for it but it'd take someone smarter than me to know what.
you can however store the value yourself as long as you keep track of it's initial value (the angle you place it at in the editor) and then adjust this value and use setrotation to apply it

i used some code in my turret script to detect when the turret was facing the player

remember to store the angle_found first
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Login to post a reply

Server time is: 2024-05-23 23:55:54
Your offset time is: 2024-05-23 23:55:54