Announcement

Collapse
No announcement yet.

Problem with actor with a static mesh component

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problem with actor with a static mesh component

    Hi,
    I'm making a 3d card game, with ue4.22.3 for android, with panoramic photos as background,
    the problem I'm finding is with the actor representing the cards. It's an actor with a static mesh component (the actual mesh of the card) and three text renderers under the mesh (you can see the structure in the first image)
    Now I have an actor which contains four of those card actors to represent the player cards (img2). I use this mostly because when I move the camera to "explore" the panoramic photos I need to move the cards accordingly to be in front of the camera.
    The problem is, sometimes when I move the GameTableBP actor or the single CardsBP actor some of the parts of the card don't move (for example, the text renderers would move but the mesh'd stay still and I can't find a way to regain control over the "lost" parts).

    Img3 is the code that moves the single card when selected. it's basically a simple lerping to a reference point (I don't know if the screen is readable, I can make it again, maybe in two parts, if needed)

    Img4 is the CardPicture details (CardPicture is the static mesh component in the CardsBP actor)

    Img5, shows the two main cards not moving with the camera and clipping with the third card which is moving.

    I sincerely don't know what else could be useful to show, so if there's something missing I'll add.

    Thanks to everyone who'll respond

    #2
    Originally posted by MattiaDiMeglio View Post
    Hi,
    I'm making a 3d card game, with ue4.22.3 for android, with panoramic photos as background,
    the problem I'm finding is with the actor representing the cards. It's an actor with a static mesh component (the actual mesh of the card) and three text renderers under the mesh (you can see the structure in the first image)
    Now I have an actor which contains four of those card actors to represent the player cards (img2). I use this mostly because when I move the camera to "explore" the panoramic photos I need to move the cards accordingly to be in front of the camera.
    The problem is, sometimes when I move the GameTableBP actor or the single CardsBP actor some of the parts of the card don't move (for example, the text renderers would move but the mesh'd stay still and I can't find a way to regain control over the "lost" parts).

    Img3 is the code that moves the single card when selected. it's basically a simple lerping to a reference point (I don't know if the screen is readable, I can make it again, maybe in two parts, if needed)

    Img4 is the CardPicture details (CardPicture is the static mesh component in the CardsBP actor)

    Img5, shows the two main cards not moving with the camera and clipping with the third card which is moving.

    I sincerely don't know what else could be useful to show, so if there's something missing I'll add.

    Thanks to everyone who'll respond
    Nice pix and description, but that code is a bit of a nightmare... ( and it's a bit too small to read )

    Main things I notice are:

    1) Move the actors, not the components. I think that's your main problem, you have to move the whole actor, not the start point component.

    2) When you use a timeline and lerp to move things around, start and end points have to be fixed, then you do the move. Don't try and calculate anything during the move...
    Check out Zof ( puzzle game ) on Steam:

    https://store.steampowered.com/app/1414480/Zof/

    Comment


      #3
      Originally posted by ClockworkOcean View Post

      Nice pix and description, but that code is a bit of a nightmare... ( and it's a bit too small to read )

      Main things I notice are:

      1) Move the actors, not the components. I think that's your main problem, you have to move the whole actor, not the start point component.

      2) When you use a timeline and lerp to move things around, start and end points have to be fixed, then you do the move. Don't try and calculate anything during the move...
      Hi! Thanks for the answer!
      Sorry for the spaghetti code, I'm not used to visual scripting and I don't really know how to make it readable LOL,

      for 1, Inside the card actor I'm moving the cardpicture component and using "start point" as a reference for the default position and "position" as a reference for the zoom end position (That naming it's not brilliant) for the lerp. I put the starting point in the card actor, but maybe it's not that good of an idea, I'll try moving it in the GameTable, so I can move the actor freely

      for 2) the problem is I have two point target actors, as reference point, that need to move with the camera, basically the lerp showed is between the start point and a "zoom point" which I use to make the card come near the camera, to make it readable for the user. I'm not sure that may be the cause, because when a component detach, doesn't move anymore

      Comment


        #4
        Originally posted by MattiaDiMeglio View Post

        Hi! Thanks for the answer!
        Sorry for the spaghetti code, I'm not used to visual scripting and I don't really know how to make it readable LOL,

        for 1, Inside the card actor I'm moving the cardpicture component and using "start point" as a reference for the default position and "position" as a reference for the zoom end position (That naming it's not brilliant) for the lerp. I put the starting point in the card actor, but maybe it's not that good of an idea, I'll try moving it in the GameTable, so I can move the actor freely

        for 2) the problem is I have two point target actors, as reference point, that need to move with the camera, basically the lerp showed is between the start point and a "zoom point" which I use to make the card come near the camera, to make it readable for the user. I'm not sure that may be the cause, because when a component detach, doesn't move anymore
        Ok, I'm not sure about the zoom stuff, but you can calculate the start point just using GetActorLocation of the card if you want to move it.
        Check out Zof ( puzzle game ) on Steam:

        https://store.steampowered.com/app/1414480/Zof/

        Comment

        Working...
        X