I’m trying to make the flashlight in my game move with the player’s camera when they are in first person mode. I’m using an animation for when the player is holding the flashlight, which keeps it in one place which makes it extremely hard to see when you aren’t looking directly in front of your character. I’m using the flashlight from Doors as an inspiration, as it moves along with the camera, but your player still has a custom holding animation different from the default arm in front of your character.
I’m fairly new to game development as a whole. I’ve tried researching for hours trying to find something that works, but everything I tried either just makes the arm go inside of the player or doesn’t work at all.
Thank you. I’m still a little confused about the viewmodels. I already have it set up so the player can see their own character in first person, so would I just have to edit the arm’s position every frame? I can send a video of what I have right now if that will help.
Just give the viewmodel a Humanoid, or in other words make it a rig (like if it was a character). So that way you can make animatable. And what do you mean by ‘the player can see their own character in first person’
If I created a duplicate character like how a viewmodel works, would I have to reanimate everything? Right now I’m just using the default roblox animations and stuff just to make it feel like the player can have some freedom with their avitars. When animating the flashlight, I already have an idle, turning on animation, and a using animation. Would I have to remake those as well?
Depends, but I would say yes. Since what you could do is paste the keyframes into the animator editor (thats animating the viewmodel), but depending on how your viewmodel is created it may not work. You could try.
That’s kind of what I’ve been trying to do, the only problem is that I have a holding animation that I don’t really know how to fix so it will follow the camera. Any ideas of how I could go about that without having to make a viewmodel and all of that stuff?
I’m not sure how to make the arm follow the camera while an animation is playing, as shown in the video. The animation that I have when the player is using the flashlight is custom and completely changes the arm’s position.
Yeah, that’s why you make it so the body follows the camera. There’s scripts out there for that and the torso will move according to where the camera points and since the arms welded to the torso, it would follow it.
Thank you! The only problem I have now is that the camera kind of just floats above the player’s body when they’re looking down. I tried to make the camera subject the player’s head, which had an interesting effect, but there were a bunch of other stuff that I’d have to fix if I were to do that. Do you have an idea of what I could possibly do?
Also, thank you so much for your help. I’m kind of a beginner when it comes to this stuff and I greatly appreciate your time helping me.