Heroes4hire's Forum Posts

  • yea, ok. actually not that bad.

    C is the point on the circle you want to get

    A is the sprite

    B is what will move

    R is the radius

    C.y= A.y+R((B.y-A.y)/√((B.x-A.x)^2+(B.y-A.y)^2)

    thought id update my post with an answer if others search for it

  • C⃗ =A⃗ +r(B⃗ −A⃗ )||B⃗ −A⃗ ||

    Where r

    is the radius of the circle. Works for points both inside and outside the circle. Imagine (B⃗ −A⃗ )

    to be a vector in the direction of B⃗

    and (B⃗ −A⃗ )||B⃗ −A⃗ ||

    thus is the same vector but with a length of 1

    . By multiplying it with r

    , you "walk in that direction" a total distance of r

    , thus reaching the circle.

    With coordinats A⃗ =(Ax,Ay)

    etc. this reads

    Cx=Ax+rBx−Ax(Bx−Ax)2+(By−Ay)2−−−−−−−−−−−−−−−−−−−−√

    Cy=Ay+rBy−Ay(Bx−Ax)2+(By−Ay)2−−−−−−−−−−−−−−−−−−−−√

    ooh boy... this will be fun

  • im moving to a sprite, but the spite has a 3d object over it. so, when pathfinding, its taking a longer route to what it deems as the best way.

    i would like to have a distance check

    i.e:

    set path to x= tile.x (+or- the radius to a closest point of the circumference)

    hope that makes sense. probably there is a sin function for it... ? or ill have to bust open some math research if no one has a script made

  • saying that. its a new day. and i have new ideas.

    couldnt i pin an invisible 3d block to mouse.

    Tried it. yeah, it highlights blocks well. if i could snap it to a grid....ahh problems for another day.

  • ROJO its been 9 years since i was here under name Aher0

    great to see you are still about. and still solving my problems.

    ill look into 3d ray cast!

  • i can click it, but it doesnt take z-elevation into account, and where it is relevant to the camera.

    i have a selector (drag on mouse down) but it wont select spites with elevation properly on overlap

    Tagged:

  • if i click a sprite. it selects the sprite. but if sprite has z elevation, it will click true, for its supposed position, not its actual position..

    (spite holds all 3d block family variables)

    3d sprites cant spawn objects?? i want to spawn and set hierarchy to a sprite that will define its animation... whats up with that? or is there a plugin?

  • ah fixed 80% of lag. just copied in code that spawns too many things

  • i exported the project as a an html file. how do i upload it?

    i read i have to save it to a server (not onedrive).. if thats true how do i do that?

    then how do i post it here.

    im having lag problems, and regenerating obstacles doesnt neem to work. all code is organised.

    its an example of selecting 3d blocks with a drag tool. movement of multiple playerbase, and digging to destroy a block.

  • so. i have bloicks, when clicked they are toggeled on to dig.

    the player moves to it and digs it.

    if you unselect it, it chooses another nearest to instance.

    problem is, its picking blocks through other blocks. it mines based on the blocks uid. so its not an overlapping problem.

    i could do check distance on arrived. but it would just check for the same block as nearest again after.

    i was thinking on having it check many blocks at once. if it cant reach on arrived choose next one on list.

    so how do i check multiple objects in ascending order?

    other solutions are super welcomed!

    ill upload this for others to see soon. ideally i wanted to finish the checks and a selector box first

  • perfect thankyou very much

  • i added a hud layer. its layer is 3, walls are layer 1.

    but 3d objects go above the hud

    any obvious way to fix this? or do i have to adjust the z elevation?

  • got a problem, i can go into 3d mode, run around. i can spawn a 3d object in front of player (meele attack). set its side to a sprite, it plays the animation. super

    but i want the block to disappear after.

    there isn't a ^when animation ends^ trigger for a 3d block.. i put in a wait on created then destroy.

    but the animation no longer plays

    i could ignore it as its invisible..... surely that will clutter performance?

    any advice? thanks all

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • yup, thatll do it

    on key is down, sat layoutangle to dt+layoutangle

  • ok, found a set layer angle. ill play around with it

    half the time posting just helps me think