|
Post by antwon on May 7, 2022 3:39:25 GMT
Hey guys, I am using the vLockOn script to lockon to enemies with the Invector shooter melee Controller, but In my game I want to rotate my camera around while still being locked on to the enemy, so I disabled strife which I don't mind keeping on but strife depends on the camera rotating to enemy. But even when disabling strife it still makes the default camera locked instead of the player being locked on. I want the player to turn towards the enemy when I am ready to fight them instead of the camera, or when his back is turned he is still looking watching his back. I am trying to achieve the movement like the character in Sifu in the Practice mode of the game, Its different in the actual gameplay. Its a martial arts open world shooter game I am making. Sample Video Below - Please guys I need help, if you can make the code for me, of guide me, I am not a pro with scripting at all, I can do some stuff but I do not know how to achieve this. Can I use the event system in the vlockon script to do this? if so how? If not please help me create this, whoever does I'll be sure to show you some love in the credits of the game.
|
|
|
Post by manwitch on May 8, 2022 3:08:23 GMT
Hey man, So I think your dealing with 2 different mechanics in the invector template.
1. The vheadtrack component: This one will let the player character keep "looking" at the enemy, there are a lot of options to fiddle with in the inspector on that component. Definitely look at that and try all the different things out so you can really see what all the things do.
2. The vcamera: This is a component added to the player characters camera (in the hierarchy drop down and see the invector components and drop that down to see the vcamera script). In that component you'll find the "camera states". It will probably be on the default state, but use that drop sown to see all the states like: aim, crouch, strafe, and so on. From your description and video, I am thinking you could probably just use the default state for attacking and/or strafe mode or change the parameters of those to more closely match the default camera state.
I'm not at a computer I can check any of this right now, but I will tomorrow, and check back in here to see if I can help (if you don't solve it by then lol)
|
|
|
Post by antwon on May 8, 2022 4:04:30 GMT
Hey man, So I think your dealing with 2 different mechanics in the invector template. 1. The vheadtrack component: This one will let the player character keep "looking" at the enemy, there are a lot of options to fiddle with in the inspector on that component. Definitely look at that and try all the different things out so you can really see what all the things do. 2. The vcamera: This is a component added to the player characters camera (in the hierarchy drop down and see the invector components and drop that down to see the vcamera script). In that component you'll find the "camera states". It will probably be on the default state, but use that drop sown to see all the states like: aim, crouch, strafe, and so on. From your description and video, I am thinking you could probably just use the default state for attacking and/or strafe mode or change the parameters of those to more closely match the default camera state. I'm not at a computer I can check any of this right now, but I will tomorrow, and check back in here to see if I can help (if you don't solve it by then lol) Man thank you so much for the response brother! I truly appreciate you so much for that. I am going to follow your instructions and see if I can figure it out, and let you know soon as I can. If you figure it out be for me yea let me know. Your a great person man, I'm grateful to have spoken to you. Many blessings to you always, we will be back in touch soon.
|
|
|
Post by antwon on May 8, 2022 6:17:34 GMT
I changed it to the default state by creating a event in the LockOn Properties, but the camera rotation is still locked after I click the LockOn button to LockOn to the Enemy. Any Idea on what is causing this to stay locked?
|
|
|
Post by manwitch on May 8, 2022 14:36:25 GMT
OK, I poked around a little this morning and, I think the problem is with the lock on script itself. So, I don't know how good you are at coding (I'm a novice to medium coder myself), but the lock on script would need to be changed so it doesn't lock the camera when active.
I tried a few things with the code and had pretty much epic fails, lol. Are you using the shooter lock on or the mele one? ... at any rate, I just started a scene on a clean project and dropped the shooter player character with inventory prefab into the scene and a mele ai prefab.
Then I just "unchecked" the vLockOnShooter component in the inspector for the shooter prefab so it's inactive and pressed play and it seems to function very close to what you're looking for.
So give that a try and let me know what you think.
|
|
|
Post by antwon on May 8, 2022 18:09:56 GMT
OK, I poked around a little this morning and, I think the problem is with the lock on script itself. So, I don't know how good you are at coding (I'm a novice to medium coder myself), but the lock on script would need to be changed so it doesn't lock the camera when active. I tried a few things with the code and had pretty much epic fails, lol. Are you using the shooter lock on or the mele one? ... at any rate, I just started a scene on a clean project and dropped the shooter player character with inventory prefab into the scene and a mele ai prefab. Then I just "unchecked" the vLockOnShooter component in the inspector for the shooter prefab so it's inactive and pressed play and it seems to function very close to what you're looking for. So give that a try and let me know what you think. Yea I agree, and my coding level is not top tier as well. I tried to unlock the camera but I don't understand how the script was coded, so I had a ton of epic fails as well. I tried using both and its pretty much the same script with a few slight changes. I tried a few things and I got it to a decent degree, I also tried your way with unchecking the lockonshooter script and it disables the lockon, and yea I have free look around and movement, the only way to stay in contact with the enemy would be to use strafe. and strafe does almost the same as the lockon script, you move a bit more freely but the character turns with the camera instead of just monitoring the enemy. What I found was the best solution was to not use lockon, just leave the camera at default, and when its time to fight players will have to either try and fight freely manually turning the character, which is not 100% accurate unless I make custom animations to create the illusion, or use strafing. Strafing does keep you in contact with the enemy, but its not ideal to what the video shows. I truly do appreciate you 100% for taking the time out of your life to reach out and try and help me, it does means a lot to me. Many blessings to you.. If you ever figure out something more closer to what they have done in the video I have shown you please let me know. Also it would be great to see a quick video of what you said you did, because unchecking lockon just disables it, I was hoping to use it, with strafing, as well as be able to rotate my camera around freely to get different angles of fighting, say if an enemy is behind the player, being able to rotate the camera with out the player rotating would be great, because head track will still detect whos behind him, and then the right animation turn or kick etc would be cool. I am thinking of doing fights were its not always one on one but, enemies try to jump you, sometimes 3 - 4 of them, and you have to use different fight styles to survive.
|
|
|
Post by manwitch on May 9, 2022 1:31:28 GMT
Hey man, so where I was going with the unchecking the lockon was to see if that was real close(which it sounds like it is) and then we could work on, maybe the headtrack script, to make the player turn to the tagged enemy on attack. Then that made me think of an addon I saw on here (but it is a paid one unfortunately) that might have the function your looking for. I'll edit this post with a link to that (just to check out) but I'll try to come up with something to get the headtrack working like I said if you want. edit to add- here's that addon - invector.proboards.com/thread/4465/paid-directional-combat-arkham-eldenSo after watching that video I'm thinking it's just a custom camera state we need to figure out for your solution. Let me know what you think and in the mean time I'll take a swing at some coding for a new camera state(no guarantees or time frame lol) P.S. no worries about any help I can provide. I've had so much help from others on here that I'd feel like I was doing wrong if I didn't help when I can.
|
|
|
Post by antwon on May 9, 2022 3:15:16 GMT
Hey man, so where I was going with the unchecking the lockon was to see if that was real close(which it sounds like it is) and then we could work on, maybe the headtrack script, to make the player turn to the tagged enemy on attack. Then that made me think of an addon I saw on here (but it is a paid one unfortunately) that might have the function your looking for. I'll edit this post with a link to that (just to check out) but I'll try to come up with something to get the headtrack working like I said if you want. edit to add- here's that addon - invector.proboards.com/thread/4465/paid-directional-combat-arkham-eldenSo after watching that video I'm thinking it's just a custom camera state we need to figure out for your solution. Let me know what you think and in the mean time I'll take a swing at some coding for a new camera state(no guarantees or time frame lol) P.S. no worries about any help I can provide. I've had so much help from others on here that I'd feel like I was doing wrong if I didn't help when I can. Yea, I think you maybe right about that. I truly appreciate you doing that, yea let me know if you figure something out that may work. I understand if nothing, I'm grateful for you trying to help even though I know you don't have to do that, means a lot. Yea take your time no rush, and thank you so much again...
|
|
|
Post by antwon on May 14, 2022 20:00:05 GMT
Hey, so I bought that addon, its really a cool feature to have, I love it. But, unfortunately It does not allow me to rotate the camera when I LockOn either. Wish I knew how to add Camera Rotation to the script without it effecting the characters movement. Have you found any good solutions?
|
|
|
Post by manwitch on May 14, 2022 21:22:48 GMT
So far, I've been working with trying to make the lock on actually lock the player character to the enemy instead of the camera locking to the enemy (which, I think is how it's working out of the box). I've made a little headway but nothing to share with you quite yet. Hopefully I can make it work like I'm thinking, lol
|
|
|
Post by antwon on May 14, 2022 22:26:21 GMT
So far, I've been working with trying to make the lock on actually lock the player character to the enemy instead of the camera locking to the enemy (which, I think is how it's working out of the box). I've made a little headway but nothing to share with you quite yet. Hopefully I can make it work like I'm thinking, lol Awesome! Can't wait to see what you are able to do. Keep me posted.
|
|
|
Post by manwitch on May 18, 2022 17:18:57 GMT
Hey man, I'm striking out on everything I try. lol I emailed the invector guys to see if they could help point us in the right direction, but they responded with - "Currently our LockOn behavior is to in fact lock on into the target, not allowing camera movement. You can modify the script in the vLockOnBehavior or create a custom lock on dedicated to do your custom mechanic."
So, I tried and tried and failed and failed lol.
I was thinking though, since you bought that addon, maybe you could contact the author and ask if there is a way to achieve this camera behavior with that addon?
I messed around with a couple fairly new games (assasins creed being one), and realized that there are already games out there that have the camera pan while locked on so it's not an outrageous thing to want the camera to do lol. I just can't figure it out and I can't find much help for it either. Any way if you get ahold of the author of that addon and find anything out please pass along the info.
In the mean time I will keep trying to get it to work, but I need to spend some time on my own project so I don't know when I'll be able to get back to this.
|
|
|
Post by antwon on May 19, 2022 12:49:46 GMT
Hey man, I'm striking out on everything I try. lol I emailed the invector guys to see if they could help point us in the right direction, but they responded with - "Currently our LockOn behavior is to in fact lock on into the target, not allowing camera movement. You can modify the script in the vLockOnBehavior or create a custom lock on dedicated to do your custom mechanic." So, I tried and tried and failed and failed lol. I was thinking though, since you bought that addon, maybe you could contact the author and ask if there is a way to achieve this camera behavior with that addon? I messed around with a couple fairly new games (assasins creed being one), and realized that there are already games out there that have the camera pan while locked on so it's not an outrageous thing to want the camera to do lol. I just can't figure it out and I can't find much help for it either. Any way if you get ahold of the author of that addon and find anything out please pass along the info. In the mean time I will keep trying to get it to work, but I need to spend some time on my own project so I don't know when I'll be able to get back to this. Okay, well I just want to say thank you so much for trying and giving your best effort to help me, even when you don't have to. I truly appreciate you for it. And I have spoken with the creator of the addon, he said he will try to add it on the next up date. If he does, I will let you no. But there are no guarantees. So hopefully he does, if so I'll let you know for sure. I'm also working with an outside coder will will look at the lock script for me soon and see if he can figure it out. Hopefully we get something. Many blessings to you.
|
|