Curved trajectories are still on the to-do list.
I don’t think appending the feature would be too much work.
I’ve narrowed down my plans to a pretty direct idea. For the next version I’m going to be appending a Gravity
property. I’ll formally document it when I release the change, but a general explanation is as follows:
The Gravity
property will be part of an individual caster object. Its default value will be 0
meaning that the trajectory is not affected by gravity. Users can set this value to whatever they please. I’ve been considering whether or not to add a method that sets the Gravity
variable to be equal to the Workspace’s Gravity
Property. I think it would be more common practice to just run Caster.Gravity = workspace.Gravity
when a user creates the object, though.
This change would require a few edits to the script that runs each ray, especially the LengthChanged
event. Right now, that event gives the start of the entire ray and the distance to the current ray point from that start value as some of its arguments, which would not be correct in terms of rotating the projectile based on flight path. I’d have to change it to be per-segment. This ideally won’t cause too many issues with migrating over from the previous version when this releases.
Given that I see a lot of the usage relates to arrows, I’ve also considered appending a second value - a Vector3, specifically - so that you can simulate wind and other factors. This value would represent a force and be added on top of the gravity value so that you can have a specific spot for gravity and a specific spot for this extra force. This feature will also benefit things like long-range weapons (sniper rifles, for instance) as they are affected by wind to a very notable extent.
Edit to blow this question out of the way: This Vector3 value will be in world space. That way, it’s easier to have a global wind value distributed to every caster. I might end up adding a way to make it behave in object space, but I don’t want to over-complicate things. Of course, as mentioned, this is all still up in the air.
When I release version 3, I’ll include documentation on these just as I did every other property.