[SOLVED] Mouse's Target giving incorrect input?
Asked by
7 years ago Edited 6 years ago
I've struggled with this issue for over a week now and my project has halted completely. The mouse object is giving a wrong object as its target whenever I click. I made this little video demonstrating the issue, alongside with the exact place in this video.
In my original project I have tried different ways to mimic the Target property, none of them has worked.
01 | function mouse:getTarget(directory) |
Where "mouse" is a custom class and realMouse the actual PlayerMouse object. The reason I cannot really use the Target property even if this issue didn't exist, is because its distance is too limited for my needs. I would be using the Ray solution but the mouse's Hit property is also giving incorrect results, which must be connected to the Target issue.
I believe the camera's Focus property is causing this all but I have no idea why. This is how I'm updating the camera, as well as setting the Focus property:
1 | function camera:update() |
3 | realCamera.CFrame = self.subject.CFrame * self.rotation * CFrame.new( 0 , 0 ,self.distance) |
4 | realCamera.Focus = realCamera.CFrame |