Einlander Posted May 28, 2015 Share Posted May 28, 2015 I'm trying to recreate portals Areial Faith Plate. The faith plate has a constant velocity even with gravity in effect. In Leadwerks on the character controller there is allways drag unless you counteract it. So here is my question, How would I go about creating a launcher that would throw the player in a set arc at a constant velocity? Quote Link to comment Share on other sites More sharing options...
gamecreator Posted May 28, 2015 Share Posted May 28, 2015 Have you tried SetVelocity http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entitysetvelocity-r822 It might not work since the character controller is kind of a custom thing After that I'd try PhysicsSetPosition or just SetPosition and do it manually Quote Link to comment Share on other sites More sharing options...
Einlander Posted May 28, 2015 Author Share Posted May 28, 2015 You can't set a character controls velocity though. Quote Link to comment Share on other sites More sharing options...
Joshua Posted May 29, 2015 Share Posted May 29, 2015 There are two ways I would approach a solution. 1. If you really want an Arc effect, you would want to use something like AddForce. You could calculate your normal vector, indicating the direction you want your player to go, multiply it by your desired force, to launch your player in the direction of your calculated normal. I had a test-case of this when I was first messing around with bullets. 2. If effecting your character controller through the use of physics methods do not work, you can always accomplish this manually, in the same way that you move your character controller. You could calculate your normal vector, like above, only this time, you would apply your desired force over time using some basic trig algorithms to calculate your arc movement. Your player could still move normally however, the arc movement would be added to your character controller movement every frame, until your desired duration of affect is over. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.