Results 1 to 3 of 3

Thread: Some tough math

  1. #1
    MSgt. Shooter Person
    Join Date
    Apr 2011
    Location
    Indiana, US
    Posts
    100

    Default Some tough math

    Hey UDK,
    What i'm trying to accomplish is essentially a Rocket projectile that will always ascend vertically for 1 second and will need to arch down like a missile strike to a designated & dynamic vector location (The vector location is my mouse coordinates which I can get no problem). So basically i'm wanting to shoot a missile projectile and have the missile land where my cursor is. My theory to accomplish this is that i'll have the Missile spawned in my playercontroller (this is a must, and i know how to do this), and in the projectile-class of the missile i'd set a timer to continuously arch the missile's rotation down but my problem is determining the amount of rotation required to meet the mouse location no matter how close or far the mouse cursor is. Any help? Maybe there's an easier way to do this?

    Thanks!

  2. #2
    MSgt. Shooter Person
    Join Date
    Jun 2011
    Location
    Augsburg, Germany
    Posts
    117

    Default

    Why is spawning it in pc a must? Just curious. Concerning your rotation problem, how about giving the projectile an acceleration and a rotation rate, and let it try rotating to aim to your currently pointed vector by itself? Anyways, the rotation the missile needs to achieve is rotator(targetlocation-currentlocation) so no tough math. And don't use a timer but tick(), so you can apply deltatime. You won't want different results on machines with different specs.

  3. #3
    Veteran
    Join Date
    Sep 2006
    Location
    Newcastle, UK
    Posts
    6,942
    Gamer IDs

    Gamertag: ambershee

    Default

    I assume it's a must because he's not using Pawns, but yeah, Misk has it. You just need to work out a desired rotation, and interpolate to it using deltatime.
    - Please do not send me questions regarding programming or implementing things in UDK via Private Message. I do not have time to respond and they are much better answered in the forums. -


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.