atfdaj
(Quoniam)
December 14, 2024, 4:36pm
#1
I have a simple casing ejection module for some VR guns, but it works nowhere near how it should.
The issue:
How it should work:
Emitter function:
local function EmitParticle(cframe: CFrame)
local particle = part:Clone()
particle.CFrame = cframe*offset
particle.Parent = workspace
particle.Transparency = 0
particle.Anchored = false
particle.Velocity = cframe:VectorToWorldSpace(velocity+Vector3.new(math.random(-gainMax.X,gainMax.X),math.random(-gainMax.Y,gainMax.Y),math.random(-gainMax.Z,gainMax.Z)))
particle.RotVelocity = angularVelocity
AddSounds(particle)
debris:AddItem(particle,lifetime)
end
slav4335
(slav)
December 14, 2024, 4:44pm
#2
-gainMax.X is sending the casings backwards
atfdaj
(Quoniam)
December 14, 2024, 4:45pm
#3
It was an easy fix. I forgot to make the casings not collide with the gun.
Hey, unrelated but what are you using any VR modules to make it work like that? I want to get into VR development but don’t really know what to use.
atfdaj
(Quoniam)
December 14, 2024, 4:47pm
#5
Everything here is custom made. I would recommend learning about UserInputService:GetUserCFrame() and Quaternions. It’s actually pretty straightforward when though about correctly.
system
(system)
Closed
December 28, 2024, 4:50pm
#7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.