Hello everyone so I'm working on a mountable entity and it is going fairly well.
However I ran into this issue of the playermodel looking like he is tilt backwards on the model he is riding.
So more or less he is leaning back looking at the sky with the crouch knife animation when he should be looking ahead.
Anyone know how I can tilt him forward?
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetAngles]Entity:SetAngles[/url]?
[editline]11th September 2016[/editline]
If you're trying to tilt the actual player instead of their model then using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/SetAllowFullRotation]Player:SetAllowFullRotation[/url] or [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/SetEyeAngles]Player:SetEyeAngles[/url] will probably work
Thanks for the reply, by chance does the first one allow the playermodel to rotate around the axis whilst in game?
Or after being set is it static?
I just need the playermodel to learn a little more ahead and stay that way.
Hopefully one of these will do the trick.
[QUOTE=Immo;51032711]Or after being set is it static?[/QUOTE]
You can run all those functions every frame if you want, they should work, but I haven't tested SetAngles on a player before. The eye angle one definitely works though
[QUOTE=MPan1;51032756]You can run all those functions every frame if you want, they should work, but I haven't tested SetAngles on a player before. The eye angle one definitely works though[/QUOTE]
[ERROR] lua/includes/extensions/math.lua:212: attempt to compare nil with number
1. Approach - lua/includes/extensions/math.lua:212
2. unknown - addons/mech/lua/entities/npc_mech/init.lua:312
Thank you for all your help so far by the way. I'm new when it comes to lua so I'm trying to figure this out. I can't use angles as it makes the mech unspawnable.
If I use any code it either throws an error or makes it unrideable.
Weirdly enough though the only command that I could enter and it actually work is self:GetRight.
Could you post the code you ran?
pl:AddEffects(EF_BONEMERGE)
else
local pos = self:GetPos()
pl:SetPos(pos +self:GetUp() *65 +self:GetForward() *18)
pl:SetParent(self)
That is the main part I'm dealing with, originally the charcter would be in the ground so I raised him up with GetUp, then used GetForward to adjust his seating.
I may be completely wrong here, but I feel as if I have to add to this part here:
pl:SetPos(pos +self:GetUp() *65 +self:GetForward() *18)
It seems to be the main playermodel position editing.
Are there any of 'Get' functions that may do the job? As those seem to be the only things that work.
Sorry, you need to Log In to post a reply to this thread.