#Mod Broken (not anymore)
91 messages ยท Page 1 of 1 (latest)
so basically this won't set if it is "equipped" or assign the "it" as the "item's" "obj" and instead only calls the audio
ok nvm turns out I was checking if the player wasn't in a seat when they had a weapon to despawn it, silly mistake 
ohh
that does make sense
whats this going to be?
Trailmakers but as a 1st person shooter sort of thing, the mod is no longer broken though
Excited to see what you make ๐
Mod Broken (not anymore)
did you bind looking up and down to buttons?
looking up and down can be binded to buttons?
trying to figure out how to turn the simple direction vector between the mouse position and the gun position into euler angles (with the cross between it and the player's transform's right vector as the up vector) so I can rotate the gun to point towards the mouse up/down position
I just meant something like press q to aim gun up press e to aim gun down
that'd be hard to use if you don't use it for a while and E is already the secondary action which in most cases is the sight
scroll wheel?
you can assign scroll wheel?
probably
https://flashbulb.atlassian.net/wiki/spaces/TMMOD/pages/218267762/Input#List-of-key-names there is no scroll wheel, I think it's a delta value in unity, so it'd probably need a seperate function
ig youre gonna have to use some other buttons
I assume you're trying to make the gun autoaim to a position that the player clicked?
just the vertical position the player clicked, so the gun's horizontal direction will still be dependent on player direction
so
press f4
click on thing
gun now aims down
press f4 again
I can finally shoot downwards
why need to press f4?
nvm, button ui would probably need you to press f4, probably wouldn't make the gun aiming up/down toggle a button though 
oh, sorry about that, in 1st person the mouse position is read from the center of the screen when the mouse is locked, I should've probably used some other word to describe it
hmm tbh i kinda wanna mess around with making a weapon system too
didnt realize that the fp controls are the same as tp
so the character doesnt strafe
is it possible to rotate the player?
yes but im not sure how that affects the movement
if it is then every time the player presses w you could add the player's rotation to an array of rotations and when the player holds a/s/d it could set the player's rotation to that
๐คทโโ๏ธ I'll have to try it then
you cant strafe or walk backwards
you can only move if your input roughly matches the direction you set
what happens? does it just walk forward if you press something like A when the player is rotated in a direction?
if so you could probably teleport the player backward by the same speed their walking forward, whatever speed that is, and if not then you can just teleport them to the right, left or backward more to try and add strafing or something similar
at the end i was pressing A/D and then S not W
so yeah basically you cant do anything about it
sweet
strafing! (sort of) (walking left/right and forward needs fixing though)
I should also probably make it so if you're walking left/right and walking forward then stop walking forward the strafe rotation is set to a 45 degree rotation of the player's instead
i think i have achieved gun
I honestly still have no idea how to make anything rotate to point towards the direction I want it to ||
|| so you're already much further ahead than me 
||(I found out how)||
how did you acheive the gun to not shoot the player when in 1st person with locked mouse cursor? (that's the only problem I'm having right now)
i didnt
idk what kind of collision box the game gave to this pistol but it sucks
then don't have collision for the pistol lol
where does the mouse click raycast even come from? it feels like its either coming from the stomach or its a spherecast
it doesnt work
no concave mesh, unity only allows convex colliders to be triggers
does the mesh have multiple objects in the file? I think that can also be an issue
its one object
ok
had that happen when I tried replacing the player with a chirpo, I couldn't fix that either so I just used concave collision instead because it doesn't just push you out of it when the player is inside it and lets you walk outside of it's collision, though idk how to fix the issue with the gun
ok I got it to work sort of (gun not rotating yet because just making sure it works before I add it)
(I took the difference between the player position + (0, 1, 0) and the mouse position as a direction)
nice
although it doesn't work if I look down
I think that's it intersecting with the character for some reason
its not the gun for sure because even after moving it up a lot, the issue still exists
yes
i dont think it even hits where it should..?
Trailmakers is my favourite fps game
Could you maybe pass some code snippet so we can easily replicate the issue on our end? ๐
And you confident it is not the rotation of the gun that is incorrect?
Ex. have you tried moving a cube or something to where the raycast hits, just to verify that it does in fact not hit where you expect it to hit? Or hitting some other collider (that you cannot see or whatever)
EDIT:
Just rewatched the last video, looks weirdly off 
Code snippet with easy replication would help a lot in getting this fixed!
if one tries to spawn something at the points where the gun would point toward you it just spawns it at somewhere around the player's character's head position
ah was hard to see what was happening, thought it was just pointing forward. Yeah looks like the raycast might be hitting the head of the character (or something similiar)
it seems almost like as if it's on the top of a capsule and it has some number for the minimum distance, but it still intersects with the capsule, but around the top and side curvature it doesn't, at least, that's something I can relate it to
here I've added lines to an image of a capsule, at around the same distance to the origin of the camera, and toward the top of the capsule it doesn't intersect, same should work horizontally, though the bottom and center do intersect, which is the same behaviour I've experienced ingame, or atleast something similar, I'm sure you're using different colliders for the player, and it seems to be in more of the shape of the players head
idk ๐คทโโ๏ธ I could be completely off
We will investigate later; but if thats the case it would just make sense to ignore the character colliders ๐
if that is the case, would it be possible to only ignore the current player's collider when in 1st person?, so I still have the ability of getting a point on another player (would be used for weapons in pvp, ect.)
I was mainly refeering to the local player and not general players.
But yeah there is also some usefulness in being able to click on your own character in third person. I'll ensure to document these requests.
in 1st person, spawning 0.01 scale cubes at the mouse position and rotating the camera in a spiral downward gave this structure, which fits mostly within the character's head model
would it be fine if I sent you the entire mod?
That would be alright, maybe just give a little instruction so we are not totally lost haha
instructions are on the in game ui