In depth explanation:
I am currently working on a gamemode, but I’m feeling kind of stuck, as I’m unsure about how to go ahead with a leaning script.
I am trying to figure out how to make a script that lets you peek and shoot from cover, like you can do in Farcry 3, when you right click while facing cover.
The only problem is I don’t know where to find the information I need, and the wiki isn’t the most usefull place in this matter.
I should make it clear that I’m not asking for a template script, but rather an explanation of some functions that could be used. The main reason for me to make the gamemode is to become a better programmer, and that means figuring out how to put the script together myself
The information I need regards:
- Is there a function that lets you alter the shooting pos of weapons? I saw that there was a Player:GetShootPos class based at viewpos on the wiki, but I couldn’t find anything on how to set the view/shoot pos.
- Is there a function that lets you calculate the distance to an edge of a wall that the player looks at? This might need an example, so I will try to provide one: each frame the server checks a function, which turns the player green if he looks at a wall, while being less than 50 units away from it. The closer the player gets to the wall, the greener he gets.
- This might require making new animations, but I was wondering if it is posible to let a players worldmodel lean a certain distance based on how far he is from an edge.
If you can help in any way, or are unsure of wether you can help, but would like more specific information, please write a comment.
Sorry for the long text and bad english and my amateur formatting.